impute mode pandas

Solutions on MaxInterview for impute mode pandas by the best coders in the world

showing results for - "impute mode pandas"
Ellery
01 Nov 2016
1df['country'].fillna(df['country'].mode()[0], inplace = True)
Glenda
16 Sep 2017
1cols = ["workclass", "native-country"]
2df[cols]=df[cols].fillna(df.mode().iloc[0])
3