我想在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
我在做什麼錯?
謝謝。解決了我的問題:) –