pandas groupby sum as dataframe code example
Example 1: pandas groupby sum
df.groupby(['Fruit','Name'])['Number'].sum()
Example 2: two groupby pandas
In [8]: grouped = df.groupby('A')
In [9]: grouped = df.groupby(['A', 'B'])
Example 3: pandas sum group by
df.groupby(['Fiscal_Year','Billing_Group'])['CHARGE_AMT'].sum()