I'm reading in a csv file into a new dataframe "df" using
df = pd.read_csv(r'C:\projects\tstr_results.csv',index_col=None)
The file has a column 'date' that is in a format of 4-Nov-2021
. df.dtypes shows 'date' to be an object.
I used the following command to the column into a datetime stamp: df['date'] = pd.to_datetime(df['date'], format='%d-%b-%Y')
However, df['date'] shows the date to be 2021-11-04
and as a dtype of datetime64[ns].
Am I missing a parameter to get to the desired format of 04-Nov-2021
?