SyntaxFix
Write A Post
Hire A Developer
Questions
Probably already too late to answer but since you have already parse the dates while loading the data, you can just do this to get the day
df['date'] = pd.DatetimeIndex(df['date']).year