xorbits.pandas.Index.notna#

Index.notna()#

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.

返回

Boolean array to indicate which entries are not NA.

返回类型

numpy.ndarray[bool]

参见

Index.notnull

Alias of notna.

Index.isna

Inverse of notna.

notna

Top-level notna.

实际案例

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])

This docstring was copied from pandas.core.indexes.base.Index.