0

I have a dataframe with 5 columns: salesman, vendor, product1, product2 and product3. The dataframe is similar to below:

Dataframe

I want to groupby salesman, loop through 'salesman' index and create a separate stacked bar chart for each salesman. For each stacked bar chart, I want x-axis to be the vendor and y-axis to stack on column values (i.e. product1/2/3 sales amount). Desired output:

Output

Have tried several methods combined with for loop but keep getting error. Appreciate any guidance on this one! Thank you.

Zephyr
  • 11,891
  • 53
  • 45
  • 80
  • Please see [how to make good reproducible pandas examples](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) and [edit] your question accordingly, thanks. – BigBen Aug 04 '20 at 18:02
  • welcome to SO, in order for others to help you need to do you bit and make your data reproducible, see [ask] and [mcve] – Umar.H Aug 04 '20 at 18:03

0 Answers0