group by and aggregation in pandas dataferame code example
Example: two groupby pandas
In [8]: grouped = df.groupby('A')
In [9]: grouped = df.groupby(['A', 'B'])
In [8]: grouped = df.groupby('A')
In [9]: grouped = df.groupby(['A', 'B'])