I am trying to extract the year, month, date, day, minutes from column.
I have the following DataFrame:
2021-01-01 00:15:00
2021-01-02 00:30:00
2021-02-05 02:15:00
2021-02-20 00:15:00
2021-04-25 22:15:00
2021-12-30 00:10:00
I am trying:
df['date'] = pd.to_datetime(df['date'])
df['year'], df['month'], df['day'], df['minute'], df['hour'],df['weekday']=df['date'].dt.year, df['date'].dt.month, df['date'].dt.day, df['date'].dt.minute, df['date'].dt.hour, df['date'].dt.isoweekday
df
Which works fine for all other attribute but dt.isoweekday is throwing error
AttributeError: 'DatetimeProperties' object has no attribute 'isoweekday'
If I replace it with dt.weekday it works fine, but I need monday=1. I have also tried dt.Timestamp.isoweekday, can any one please guide why isoweekday function is not working?
I am using pandas 1.3.4