I have a pandas dataframe with a row
clear_date
2019-11-06 00:00:00
2019-11-06 00:00:00
...
type(clear_date) = object
I want to subtract this column from another date-time column whose type is date-time and format '%Y%m%d'.
pd.to_datetime(data['clear_date']).dt.day
I have tried using the above command but the type of clear_date still remains as object and does not change to time-date object and hence I can't subtract another time-date column with it.
How to change it to date-time object with format '%Y%m%d'.