In the Titanic data set passengers, sex and age are given, but there are some empty values for age. I would like to enter the average by sex
.
Sex
female 27.915709
male 30.726645
Where the sex is equal to male I would like to ent the average male age and the same for sex equal to female
I'm somewhat new haven't tried too much
titanic.Sex = 'male' and titanic.Age.fillna(mean_homme)
The Nan for male age will equal the average male age