且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

非"NaN"指数 pandas 的价值观

更新时间:2023-02-27 09:24:07

只需过滤它们

In [62]:

df['b'].notnull()

Out[62]:
0     True
1    False
2     True
3     True
4     True
Name: b, dtype: bool
In [63]:

df[df['b'].notnull()]
Out[63]:
   A   b   c
0  1  q1   1
2  3  q2   3
3  4  q1 NaN
4  5  q2   7