Pandas Fillna Mode

后端 未结 6 1281
借酒劲吻你
借酒劲吻你 2021-02-05 12:13

I have a data set in which there is a column known as Native Country which contain around 30000 records. Some are missing represented by NaN so I thoug

6条回答
  •  佛祖请我去吃肉
    2021-02-05 12:26

    Try something like: fill_mode = lambda col: col.fillna(col.mode()) and for the function: new_df = df.apply(fill_mode, axis=0)

提交回复
热议问题