A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/docs/dev/user_guide/../reference/api/pandas.Index.notna.html below:

pandas.Index.notna — pandas 3.0.0.dev0+2231.g4f2aa4d2be documentation

pandas.Index.notna#
final Index.notna()[source]#

Detect existing (non-missing) values.

Return a boolean same-sized object indicating if the values are not NA. Non-missing values get mapped to True. Characters such as empty strings '' or numpy.inf are not considered NA values. NA values, such as None or numpy.NaN, get mapped to False values.

Returns:
numpy.ndarray[bool]

Boolean array to indicate which entries are not NA.

See also

Index.notnull

Alias of notna.

Index.isna

Inverse of notna.

notna

Top-level notna.

Examples

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

>>> idx = pd.Index([5.2, 6.0, np.nan])
>>> idx
Index([5.2, 6.0, nan], dtype='float64')
>>> idx.notna()
array([ True,  True, False])

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

>>> idx = pd.Index(["black", "", "red", None])
>>> idx
Index(['black', '', 'red', None], dtype='object')
>>> idx.notna()
array([ True,  True,  True, False])

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4