Datetime Index to Months

Dear Community,

I’m trying to convert the below Dataframe’s index column into respective months but failed to do so. While, in Jupyter, I found couple of ways to perform the same task but the codes are not functional in streamlit app. Please help!!