Querying for NaN and other names in Pandas

后端 未结 7 1597
生来不讨喜
生来不讨喜 2020-12-12 20:50

Say I have a dataframe df with a column value holding some float values and some NaN. How can I get the part of the dataframe where we

7条回答
  •  生来不讨喜
    2020-12-12 21:01

    For rows where value is not null

    df.query("value == value")
    

    For rows where value is null

    df.query("value != value")
    

提交回复
热议问题