python dataframe groupby sum code example
Example 1: pandas groupby sum
df.groupby(['Fruit','Name'])['Number'].sum()
Example 2: pandas sum multiple columns groupby
df.groupby(['col1','col2']).agg({'col3':'sum','col4':'sum'}).reset_index()
df.groupby(['Fruit','Name'])['Number'].sum()
df.groupby(['col1','col2']).agg({'col3':'sum','col4':'sum'}).reset_index()