Groupby Error on new update

I just upgraded anaconda to 23.9.0 on my Mac. I went to an old file to re-run it and keep getting hit with an error on a groupby method.

  • TypeError: can only concatenate str (not “int”) to str
  • TypeError: agg function failed [how->mean,dtype->object]

this is super frustrating as my other computer (different version) of Anaconda, has no problem running this cell

example: fraudtype_df.groupby([‘category’]).agg({‘amount’: ‘mean’, ‘fraud’ : ‘mean’})

This gives me the category which is a string along with the mean of the amount of fraud and the fraud risk which are both floating points.

1 Like

This fixed similar issue I had. Thnx!

use .mean(numeric_only=True)