def option113(): import pandas as pd xl = pd.ExcelFile("FA18SalesData.xlsx") SalesData = xl.parse("Orders") top_frequent = SalesData["City"].value_counts() percent.percentage(top_frequent)
def option211(): import pandas as pd xl = pd.ExcelFile("FA18SalesData.xlsx") OrdersOnlyData = xl.parse("Orders") prod_prof_col = OrdersOnlyData[["Product Name", "Profit"]] prod_prof = prod_prof_col.groupby(by="Product Name").sum().sort_values(by="Profit", ascending = True) percent.percentage(prod_prof)
def option123(): import pandas as pd xl = pd.ExcelFile("FA18SalesData.xlsx") OrdersOnlyData = xl.parse("Orders") city_prof_col = OrdersOnlyData[["City", "Profit"]] city_prof = city_prof_col.groupby(by="City").sum().sort_values( by="Profit", ascending=False) percent.percentage(city_prof)