I have a column with dates in string format \'2017-01-01\'. Is there a way to extract day and month from it using pandas?
\'2017-01-01\'
I have converted the column to
This should do it:
df['day'] = df['Date'].apply(lambda r:r.day) df['month'] = df['Date'].apply(lambda r:r.month)