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$
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, privacy policy and cookie policy

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