pandas value_counts applied to each column

前端 未结 6 987
甜味超标
甜味超标 2020-12-09 17:30

I have a dataframe with numerous columns (≈30) from an external source (csv file) but several of them have no value or always the same. Thus, I would to see qui

6条回答
  •  自闭症患者
    2020-12-09 17:51

    you can use df.apply which will apply each column with provided function, in this case counting missing value. This is what it looks like,

    df.apply(lambda x: x.isnull().value_counts())

提交回复
热议问题