@@ -5591,7 +5591,7 @@ def asof(self, where, subset=None):
5591
5591
NA values, such as None or :attr:`numpy.NaN`, gets mapped to True
5592
5592
values.
5593
5593
Everything else gets mapped to False values. Characters such as empty
5594
- strings `'' ` or :attr:`numpy.inf` are not considered NA values
5594
+ strings ``''` ` or :attr:`numpy.inf` are not considered NA values
5595
5595
(unless you set ``pandas.options.mode.use_inf_as_na = True``).
5596
5596
5597
5597
Returns
@@ -5653,14 +5653,63 @@ def isnull(self):
5653
5653
return isna (self ).__finalize__ (self )
5654
5654
5655
5655
_shared_docs ['notna' ] = """
5656
- Return a boolean same-sized object indicating if the values are
5657
- not NA.
5656
+ Detect existing (non-missing) values.
5657
+
5658
+ Return a boolean same-sized object indicating if the values are not NA.
5659
+ Non-missing values get mapped to True. Characters such as empty
5660
+ strings ``''`` or :attr:`numpy.inf` are not considered NA values
5661
+ (unless you set ``pandas.options.mode.use_inf_as_na = True``).
5662
+ NA values, such as None or :attr:`numpy.NaN`, get mapped to False
5663
+ values.
5664
+
5665
+ Returns
5666
+ -------
5667
+ %(klass)s
5668
+ Mask of bool values for each element in %(klass)s that
5669
+ indicates whether an element is not an NA value.
5658
5670
5659
5671
See Also
5660
5672
--------
5661
- %(klass)s.isna : boolean inverse of notna
5662
5673
%(klass)s.notnull : alias of notna
5674
+ %(klass)s.isna : boolean inverse of notna
5675
+ %(klass)s.dropna : omit axes labels with missing values
5663
5676
notna : top-level notna
5677
+
5678
+ Examples
5679
+ --------
5680
+ Show which entries in a DataFrame are not NA.
5681
+
5682
+ >>> df = pd.DataFrame({'age': [5, 6, np.NaN],
5683
+ ... 'born': [pd.NaT, pd.Timestamp('1939-05-27'),
5684
+ ... pd.Timestamp('1940-04-25')],
5685
+ ... 'name': ['Alfred', 'Batman', ''],
5686
+ ... 'toy': [None, 'Batmobile', 'Joker']})
5687
+ >>> df
5688
+ age born name toy
5689
+ 0 5.0 NaT Alfred None
5690
+ 1 6.0 1939-05-27 Batman Batmobile
5691
+ 2 NaN 1940-04-25 Joker
5692
+
5693
+ >>> df.notna()
5694
+ age born name toy
5695
+ 0 True False True False
5696
+ 1 True True True True
5697
+ 2 False True True True
5698
+
5699
+ Show which entries in a Series are not NA.
5700
+
5701
+ >>> ser = pd.Series([5, 6, np.NaN])
5702
+ >>> ser
5703
+ 0 5.0
5704
+ 1 6.0
5705
+ 2 NaN
5706
+ dtype: float64
5707
+
5708
+ >>> ser.notna()
5709
+ 0 True
5710
+ 1 True
5711
+ 2 False
5712
+ dtype: bool
5664
5713
"""
5665
5714
5666
5715
@Appender (_shared_docs ['notna' ] % _shared_doc_kwargs )
0 commit comments