how to calculate the mean value using groupby in pandas and then plot code example Example: pandas groupby mean df.groupby(['A', 'B']).mean()