Pandas isna() and isnull(), what is the difference?

后端 未结 3 1126
盖世英雄少女心
盖世英雄少女心 2020-12-14 06:22

Pandas has both isna() and isnull(). I usually use isnull() to detect missing values and have never met the case so that I had to use

3条回答
  •  情歌与酒
    2020-12-14 06:41

    The documentation for both is literally identical.

    pandas.isna() : https://pandas.pydata.org/pandas-docs/stable/generated/pandas.isna.html#pandas.isna

    pandas.isnull() : https://pandas.pydata.org/pandas-docs/stable/generated/pandas.isnull.html#pandas.isnull

    In here, it even says DataFrame.isnull is an alias of isna in See also section.

    pandas.DataFrame.isnull(): https://pandas-docs.github.io/pandas-docs-travis/generated/pandas.DataFrame.isnull.html#pandas.DataFrame.isnull

    Therefore, they must be the same thing, like np.nan, np.NaN, np.NAN.

提交回复
热议问题