pandas astype datetime yyyymmdd code example
Example: pandas astype datetime
# converting the string to datetime format
df['Dates'] = pd.to_datetime(df['Dates'], format='%y%m%d')
# printing dataframe
print(df)
print(df.dtypes)
# converting the string to datetime format
df['Dates'] = pd.to_datetime(df['Dates'], format='%y%m%d')
# printing dataframe
print(df)
print(df.dtypes)