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

后端 未结 3 1130
盖世英雄少女心
盖世英雄少女心 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-14 06:38

    They both are same. As a best practice, always prefer to use isna() over isnull().

    It is easy to remember what isna() is doing because when you look at numpy method np.isnan(), it checks NaN values. In pandas there are other similar method names like dropna(), fillna() that handles missing values and it always helps to remember easily.

提交回复
热议问题