I am using python version 3.7.
I have a dataframe, df that contains one column called TDate.
The column looks like below.
2019-01-01 00:00:00
2019-01-02 00:00:00
2019-01-03 00:00:00
2019-01-04 00:00:00
When I do df.dtypes it tell me the column is of type object.
I then have the line below,
myDates = pd.to_datetime(df['TDate'])
So myDates is a pandas Series.
However if I access one element of this myDates series and check the type it tells me it is a libs.tslib.timestamps.Timestamp
I just want to convert the original dataframe column from an object to a date in the format yyyy-mm-dd. What is the best way of doing this?
I looked at converting a timestamp to a date but that didn't work as the timestamp is a string literal not a integer.