@@ -2206,18 +2206,47 @@ def isna(self):
2206
2206
2207
2207
def notna (self ):
2208
2208
"""
2209
- Inverse of isna
2209
+ Detect existing (non-missing) values.
2210
+
2211
+ Return a boolean same-sized object indicating if the values are not NA.
2212
+ Non-missing values get mapped to ``True``. Characters such as empty
2213
+ strings ``''`` or :attr:`numpy.inf` are not considered NA values
2214
+ (unless you set ``pandas.options.mode.use_inf_as_na = True``).
2215
+ NA values, such as None or :attr:`numpy.NaN`, get mapped to ``False``
2216
+ values.
2210
2217
2211
2218
.. versionadded:: 0.20.0
2212
2219
2213
2220
Returns
2214
2221
-------
2215
- a boolean array of whether my values are not NA
2222
+ numpy.ndarray
2223
+ Boolean array to indicate which entries are not NA.
2216
2224
2217
2225
See also
2218
2226
--------
2219
- notnull : alias of notna
2227
+ Index.notnull : alias of notna
2228
+ Index.isna: inverse of notna
2220
2229
pandas.notna : top-level notna
2230
+
2231
+ Examples
2232
+ --------
2233
+ Show which entries in an Index are not NA. The result is an
2234
+ array.
2235
+
2236
+ >>> idx = pd.Index([5.2, 6.0, np.NaN])
2237
+ >>> idx
2238
+ Float64Index([5.2, 6.0, nan], dtype='float64')
2239
+ >>> idx.notna()
2240
+ array([ True, True, False])
2241
+
2242
+ Empty strings are not considered NA values. None is considered a NA
2243
+ value.
2244
+
2245
+ >>> idx = pd.Index(['black', '', 'red', None])
2246
+ >>> idx
2247
+ Index(['black', '', 'red', None], dtype='object')
2248
+ >>> idx.notna()
2249
+ array([ True, True, True, False])
2221
2250
"""
2222
2251
return ~ self .isna ()
2223
2252
notnull = notna
0 commit comments