How do I get a summary count of missing/NaN data by column in 'pandas'?

后端 未结 5 1543
梦谈多话
梦谈多话 2020-12-23 17:06

In R I can quickly see a count of missing data using the summary command, but the equivalent pandas DataFrame method, describe

5条回答
  •  独厮守ぢ
    2020-12-23 17:48

    If you didn't care which columns had Nan's and you just wanted to check overall, just add a second .sum() to get a single value.

    result = df.isnull().sum().sum()
    result > 0
    

    a Series would only need one .sum() and a Panel() would need three

提交回复
热议问题