I have a Dataframe, df, with the following column:
df[\'ArrivalDate\'] = ... 936 2012-12-31 938 2012-12-29 965 2012-12-31 966 2012-12-31 967 2012-1
You can first convert your date strings with pandas.to_datetime, which gives you access to all of the numpy datetime and timedelta facilities. For example:
df['ArrivalDate'] = pandas.to_datetime(df['ArrivalDate']) df['Month'] = df['ArrivalDate'].values.astype('datetime64[M]')