group by and sum in pandas code example
Example 1: pandas groupby sum
df.groupby(['Fruit','Name'])['Number'].sum()
Example 2: pandas groupby sum
df.groupby(['att1', 'att2']).agg({'att1': "count", 'att3': "sum",'att4': 'mean'})
Example 3: pandas sum group by
df.groupby(['Fiscal_Year','Billing_Group'])['CHARGE_AMT'].sum()