热线电话:13121318867

登录
2018-12-19 阅读量: 1101
dropna函数的用处

您可能希望简单地从引用缺失数据的数据集中排除标签。为此,请使用dropna():

In [56]: df

Out[56]:

one two three

a NaN 0.501113 -0.355322

c NaN 0.580967 0.983801

e NaN 0.000000 0.000000

f NaN 0.000000 0.000000

h NaN -1.053898 -0.019369

In [57]: df.dropna(axis=0)

Out[57]:

Empty DataFrame

Columns: [one, two, three]

Index: []

In [58]: df.dropna(axis=1)

Out[58]:

two three

a 0.501113 -0.355322

c 0.580967 0.983801

e 0.000000 0.000000

f 0.000000 0.000000

h -1.053898 -0.019369

In [59]: df['one'].dropna()

Out[59]: Series([], Name: one, dtype: float64)

0.0000
5
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子