I have a pandas DataFrame with index column = date.
date
Input:
value date 1986-01-31 22.93 1986-02-28 15.46
You can also use string datetime formating:
df['month'] = df['date'].dt.strftime('%Y-%m-01')