how to separate year from datetime column in python

58

how to separate year from datetime column in python -

df['year'] = pd.DatetimeIndex(df['ArrivalDate']).year
df['month'] = pd.DatetimeIndex(df['ArrivalDate']).month

Comments

Submit
0 Comments