Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

pandas.Index.notna#

finalIndex.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 toTrue. Characters such as emptystrings'' ornumpy.inf are not considered NA values.NA values, such as None ornumpy.NaN, get mapped toFalsevalues.

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 anarray.

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

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

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

[8]ページ先頭

©2009-2025 Movatter.jp