ITTONE Création des applications Web

python – pandas.core.base.DataError: No numeric types to aggregate when trying to get the mean with groupby

I’m getting the error: “pandas.core.base.DataError: No numeric types to aggregate” when I try to get the mean of a column values based on the values of another column.

This is how the columns look:

   PRESSEDKEY  PALABRA   COLOR KEYCORR   RT CORRECT
90           v    ABUSO     red       r  496       N
108          v  FRACASO    blue       a  168       N
138          v   MORGUE   green       v  106       Y
150          v    ENOJO     red       r    0       N
156          v     ODIO   green       v   25       Y

I’m trying to get the mean RT of the values “N” and “Y” in the CORRECT column.

This is what I’m trying and gives me the mentioned error:

mean_emo = df_emowords.groupby('CORRECT')['RT'].mean()

How can I solve this?

Product of the Month September 2016

Source link

Leave a Comment

Your email address will not be published. Required fields are marked *