Function turns Values to NaN unwanted
Advertisements I wrote a function to fill NaN with Values, but instead this function first fills the NaN with values and then deletes every value that was in the list before I did the function def preprocessing(df): median_male_3= df[(df["Sex"]=="male") & (df["Pclass"] ==3 )]["Age"].median() median_male_2= df[(df["Sex"]=="male") & (df["Pclass"] ==2 )]["Age"].median() median_male_1= df[(df["Sex"]=="male") & (df["Pclass"] ==1 )]["Age"].median()… Read More Function turns Values to NaN unwanted