how to separate year from datetime column in python

Solutions on MaxInterview for how to separate year from datetime column in python by the best coders in the world

showing results for - "how to separate year from datetime column in python"
Yannick
28 Aug 2016
1df['year'] = pd.DatetimeIndex(df['ArrivalDate']).year
2df['month'] = pd.DatetimeIndex(df['ArrivalDate']).month
3