# 8.51:  Multi-column aggregation (.groupby() and .pivot_table()).  Show sums of 'SaleAmount' and
# 'Quantity' grouped by 'SalesRep' and by 'Product'.

import pandas as pd

df = pd.read_excel("../sales-funnel.xlsx")

dfgb = df.groupby(['SalesRep', 'Product'])[['SaleAmount', 'Quantity']].sum()

dfgb


dfpt = pd.pivot_table(df, index=['SalesRep', 'Product'],
                          values=['SaleAmount', 'Quantity'], aggfunc='sum')

dfpt

