热线电话:13121318867

登录
2019-06-18 阅读量: 521
python如何检查缺失值

为了检查Pandas DataFrame中的空值,我们使用isnull()函数this函数返回布尔值的数据帧,对于NaN值,这些值为True。

代码#:

# importing pandas as pd

import pandas as pd

# importing numpy as np

import numpy as np

# dictionary of lists

dict = {'First Score':[100, 90, np.nan, 95],

'Second Score': [30, 45, 56, np.nan],

'Third Score':[np.nan, 40, 80, 98]}

# creating a dataframe from list

df = pd.DataFrame(dict)

# using isnull() function

df.isnull()

输出:

42.0390
2
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子