Which area is contributing most to the gross sales for the 12 months 2016?
To seek out the area, we use the next code:
import matplotlib.pyplot as plt
import seaborn as snsgb_sales2=gross sales.groupby(by="Area")[["Sales2016"]].sum()
res_2=gb_sales2.reset_index()plt.pie(x="Sales2016",labels="Area", information=res_2, autopct="%.2f %%",colours=["r","g","b"])
plt.xlabel("Gross sales 2016")
plt.present()
Examine the whole gross sales of 2015 and 2016 with respect to Area and Tiers
To seek out the tiers, we use the next code:
gb_sales3=gross sales.groupby(by=["Region", "Tier"]).combination({"Sales2015":"sum", "Sales2016":"sum"})
gb_res_3=gb_sales3.pivot_table(index="Area", columns="Tier", values=["Sales2015","Sales2016"])
plt.determine(figsize=(10,8))
gb_res_3.plot.bar(figsize=(18,6))
plt.present()
plt.determine(figsize=(10,8))
res_3.plot(form="bar",stacked=True)
plt.present()
Evaluating completely different divisions in excessive tier with respect to the variety of items bought within the 12 months 2015 & 2016
Use the next code to finish this job:
sales_tier_high=gross sales[sales.Tier=="High"]
gb_div=sales_tier_high.groupby(by="Division").combination({"Units2015":"sum", "Units2016":"sum"})gb_div.plot.bar(figsize=(18,6))