Open rahulpinto19 opened 2 months ago
try with this to handle non numeric columns separately to keep non numeric columns perform aggregation differently.
gender_group = df.groupby('gender').agg({
'math_score': 'mean', #replace by column names
'reading_score': 'mean',
'writing_score': 'mean' # change to 'count', or other suitable aggregations
})
print(gender_group)
I have gone through this error as the gender is not a number we are unable to find out the mean we can solve this by converting it into the number