I have a column in my pandas data frame containing dates in the format 'mmddyyyy' with object datatype Eg - 03292021,06262021,01282020....
I'm trying to convert this column into a date column with the format 'mm/dd/yyyy'. Eg - 03/29/2021
Example of the code that I've tried is below:
df['datecol'] = pd.to_datetime(df['datecol'])
df['datecol'] = df['datecol'].dt.strftime('%m/%d/%y')
which gives me the error
month must be in 1..12: 03292021
What changes should be made in the code to get the desired output?