groupby columns pandas aggregate sum 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'])
df.groupby(['Fruit','Name'])['Number'].sum()
In [8]: grouped = df.groupby('A')
In [9]: grouped = df.groupby(['A', 'B'])