Reputation: 3340
The date column that I have in the dataframe is of float
type.
I was able to convert it in to YYYY-MM-DD format using the below:
pd.to_datetime(df['Date'], format = '%Y%m%d')
How can I convert it to YYYY-MM? tried the below and it didn't help.
pd.to_datetime(df['Date'], format = '%Y%m')
Upvotes: 0
Views: 479