'Matplotlib barplot grouping by multiple columns not working

I have been trying to do an aggregated bar plot by using groupby multiple columns of my dataframe. My dataframe looks like the below one, with quite a few extra columns (not included here)

Revenue per day | Month | Customer
   150          |  Jan  |    A
   120          |  Jan  |    B
   330          |  Jan  |    C
   .
   .
   .
   250          |  Dec  |    A

I am trying to draw a barplot comprising of the cumulative sum of the revenue, grouped by month and the customer. If it would have been categorical data, I could have used Pandas.crosstab() function for plotting but since it is numerical data, I can only group by one single column and not both. My approach is as follows :

df['new_grouped_col'] = df.groupby(['Month', 'Customer'])['Revenue per day'].cumsum()
df.plot.bar()

But it returns nothing



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source