I've a dataframe of this format -
var1 date
A 2017/01/01
A 2017/01/02
...
I want the date to be converted into YYYY-MM
format but the df['date'].dtype
is object
.
How can I remove the day part from date while keeping the data type as datetime?
Expected Output -
A - 2017/01
Thanks