pandas 1.4.2

ReturnsBackRef
isna(self) -> 'npt.NDArray[np.bool_]'

Return a boolean same-sized object indicating if the values are NA. NA values, such as None , numpy.NaN or pd.NaT , get mapped to True values. Everything else get mapped to False values. Characters such as empty strings :None:None:`''` or numpy.inf are not considered NA values (unless you set pandas.options.mode.use_inf_as_na = True ).

Returns

numpy.ndarray[bool]

A boolean array of whether my values are NA.

Detect missing values.

See Also

Index.dropna

Omit entries with missing values.

Index.notna

Boolean inverse of isna.

Series.isna

Detect missing values in Series object.

isna

Top-level isna.

Examples

Show which entries in a pandas.Index are NA. The result is an array.

This example is valid syntax, but we were not able to check execution
>>> idx = pd.Index([5.2, 6.0, np.NaN])
... idx Float64Index([5.2, 6.0, nan], dtype='float64')
This example is valid syntax, but we were not able to check execution
>>> idx.isna()
array([False, False,  True])

Empty strings are not considered NA values. None is considered an NA value.

This example is valid syntax, but we were not able to check execution
>>> idx = pd.Index(['black', '', 'red', None])
... idx Index(['black', '', 'red', None], dtype='object')
This example is valid syntax, but we were not able to check execution
>>> idx.isna()
array([False, False, False,  True])

For datetimes, :None:None:`NaT` (Not a Time) is considered as an NA value.

This example is valid syntax, but we were not able to check execution
>>> idx = pd.DatetimeIndex([pd.Timestamp('1940-04-25'),
...  pd.Timestamp(''), None, pd.NaT])
... idx DatetimeIndex(['1940-04-25', 'NaT', 'NaT', 'NaT'], dtype='datetime64[ns]', freq=None)
This example is valid syntax, but we were not able to check execution
>>> idx.isna()
array([False,  True,  True,  True])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.core.indexes.base.Index.notna pandas.core.indexes.base.Index.isna pandas.core.dtypes.missing.isna

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/indexes/base.py#2677
type: <class 'function'>
Commit: