Pandas - check if ALL values are NaN in Series

后端 未结 2 1686
栀梦
栀梦 2021-02-03 17:22

I have a data series which looks like this:

print mys

id_L1
2       NaN
3       NaN
4       NaN
5       NaN
6       NaN
7       NaN
8       NaN
<
相关标签:
2条回答
  • 2021-02-03 17:57

    Yes, that's correct, but I think a more idiomatic way would be:

    mys.isnull().all()
    
    0 讨论(0)
  • 2021-02-03 18:02

    This will check for all columns..

    mys.isnull().values.all(axis=0)
    
    0 讨论(0)
提交回复
热议问题