open_in_new
content_copy
df['year'] = df['date'].dt.year if we put dt.month is for month etc.. df.head()