0

[enter image description here][1]i have the following dataframe:

year    event   Gender  population
2013    10k       F          1995
2013    10k       M          3783
2013    21k       F          526
2013    21k       M          2194
2013    42k       F          130
2013    42k       M          710
2014    10k       F          2735
2014    10k       M          4729
2014    21k       F          885
2014    21k       M          3085
2014    42k       F          216
2014    42k       M          1274

i would like to create a multilevel stack plot that will look like this:

like this:

igor_mintz
  • 13
  • 2
  • 2
    `df.set_index(['year','event','Gender'])['population'].unstack().plot(kind='bar',stacked=True) ` – BENY Jul 24 '18 at 15:46
  • Possible duplicate of [pandas - multi index plotting](https://stackoverflow.com/questions/31845258/pandas-multi-index-plotting) – rpanai Jul 24 '18 at 15:49

0 Answers0