Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.

Examples
Show which entries in a DataFrame are NA.

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame({'age': [6, 7, np.NaN],
                   'born': [pd.NaT, pd.Timestamp('1989-05-28'),
                            pd.Timestamp('1990-04-26')],
                   'name': ['Phantom', 'Batman', ''],
                   'toy': [None, 'Batmobile', 'Joker']})
df
Out[2]:
age born name toy
0 6.0 NaT Phantom None
1 7.0 1989-05-28 Batman Batmobile
2 NaN 1990-04-26 Joker
In [3]:
df.isna()
Out[3]:
age born name toy
0 False True False True
1 False False False False
2 True False False False

Show which entries in a Series are NA.

In [4]:
s = pd.Series([6, 7, np.NaN])
s
Out[4]:
0    6.0
1    7.0
2    NaN
dtype: float64
In [5]:
s.isna()
Out[5]:
0    False
1    False
2     True
dtype: bool