#Exctract month and create a dedicated column df["Month"] from a
#column in datetime format df["Date"]
df['Month'] = pd.DatetimeIndex(df['Date']).month
df['StartDate'].dt.to_period('M')
result:
0 2021-08
1 2021-08
2 2021-08
pd.to_datetime(df[["Year", "Month", "Day"]])
df['month_year'] = df['date_column'].dt.to_period('M')