python pandas extract year from datetime: df[‘year’] = df[‘date’].year is not working
I import a dataframe via read_csv, but for some reason can’t extract the year or month from the series df['date'], trying that gives AttributeError: 'Series' object has no attribute 'year':