Skip to content
Advertisement

I’m trying to get a concatenated Pandas dataframe that is the result of the calculated mean of several columns

As mentioned above, I’m trying to get the mean of several columns then concatenate the resulting dataframes into a new dataframe. I’m getting the following error:

FutureWarning: Dropping of nuisance columns in DataFrame reductions (with ‘numeric_only=None’) is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction. summaryData[‘aver_51’] = summaryData[[“5.1.2 Hello World Quiz”,

Here is the code:

JavaScript

Advertisement

Answer

“Nuisance columns” are actually just columns that pandas can’t process in the current operation (e.g., strings); in this case, mean. You’ll have to get rid of all the columns/cells that contain strings before you can compute the mean.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement