我想在DataFrame中找到空值。虽然我从Stackoverflow中回顾了以下文章,描述了确定空值的过程,但我很难为我的数据集做同样的事情。Python数据帧得到空值计数
How to count the Nan values in the column in Panda Data frame
工作代码:
import pandas as pd
a = ['america','britain','brazil','','china','jamaica'] #I deliberately introduce a NULL value
a = pd.DataFrame(a)
a.isnull()
#Output:
False
1 False
2 False
3 False
4 False
5 False
a.isnull().sum()
#Output
#0 0
#dtype: int64
我在做什么错?
谢谢。解决了我的问题:) –