pandas get month and year datetime64[ns] code example
Example: month from datetime pandas
#Exctract month and create a dedicated column df["Month"] from a
#column in datetime format df["Date"]
df['Month'] = pd.DatetimeIndex(df['Date']).month
#Exctract month and create a dedicated column df["Month"] from a
#column in datetime format df["Date"]
df['Month'] = pd.DatetimeIndex(df['Date']).month