Impute categorical missing values in scikit-learn

后端 未结 10 1404
清歌不尽
清歌不尽 2020-11-30 16:55

I\'ve got pandas data with some columns of text type. There are some NaN values along with these text columns. What I\'m trying to do is to impute those NaN\'s by skle

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 17:45

    You could try the following:

    replace = df..value_counts().argmax()
    
    df[''].fillna(replace, inplace=True) 
    
    

提交回复
热议问题