pandas groupby and mean of a colum code example Example: pandas groupby mean df.groupby(['A', 'B']).mean()