0
$\begingroup$

traindf[traindf['Gender'] == 'female']['Age'].fillna(value=femage,inplace=True)

I've tried to update the null values in the age column in the dataframe with the mean values.Here I tried to replace the null values in the age column of female gender with the female mean age.But the column doesn't get updated.why?

$\endgroup$

1 Answer 1

0
$\begingroup$
traindf.loc[traindf['Gender'] == 'female','Age'] = traindf.loc[traindf['Gender'] == 'female','Age'].fillna(value=femage)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.