I have the following data set:

df

```
OrderDate Total_Charged

7/9/2017 5
7/9/2017 5
7/20/2017 10
8/20/2017 6
9/20/2019 1

```

...

I want to make a bar plot with month\_year (X-axis) and Total charged per month/year i.e. sum it over month and year. Firstly, I want to groupby month and year and next make the plot.However, I get error on the first step: 

```
df["OrderDate"]=pd.to_datetime(df['OrderDate'])
monthly_orders=df.groupby([(df.index.year),(df.index.month)]).sum()["Total_Charged"]

```

Got following error: 

> 
> AttributeError: 'RangeIndex' object has no attribute 'year'
> 
> 
> 

What am I doing wrong (what does the error mean)? How can i fix it?