count values aggregate on two columns as df python code example
Example 1: python groupby sum single columns
df.groupby(['A','C'], as_index=False)['B'].sum()
Example 2: two groupby pandas
In [8]: grouped = df.groupby('A')
In [9]: grouped = df.groupby(['A', 'B'])