how to calculate mean of one column of specific group in pandas code example Example: pandas groupby mean df.groupby(['A', 'B']).mean()