Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to separate year from datetime column in python

df['year'] = pd.DatetimeIndex(df['ArrivalDate']).year
df['month'] = pd.DatetimeIndex(df['ArrivalDate']).month
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #separate #year #datetime #column #python
ADD COMMENT
Topic
Name
6+6 =