Data Import

In [3]:
import matplotlib.pyplot as plt
import pandas as pd
#Please adjust to your file
df=pd.read_excel("/Users/davidmika/Desktop/First.xlsx","Sheet1")

Stacked Column Chart

In [7]:
# Group sum of sales at gender and BMI level
var = df.groupby(['BMI','Gender']).Sales.sum()
var.unstack().plot(kind='bar',stacked=True, color=['red','blue'], grid=False)
#Show stacked column chart
plt.show()
In [ ]: