how to extract month from date column in python code example
Example: to extract out only year month from a date column in pandas
df['month_year'] = df['date_column'].dt.to_period('M')
df['month_year'] = df['date_column'].dt.to_period('M')