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