Skip to content

Commit 7555789

Browse files
committed
update doc-strings
1 parent 767ca7b commit 7555789

File tree

7 files changed

+62
-12
lines changed

7 files changed

+62
-12
lines changed

doc/source/api.rst

+2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ Top-level missing data
188188
:toctree: generated/
189189

190190
isna
191+
isnull
191192
notna
193+
notnull
192194

193195
Top-level conversions
194196
~~~~~~~~~~~~~~~~~~~~~

pandas/core/categorical.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,8 @@ def isna(self):
11651165
11661166
See also
11671167
--------
1168-
isna : pandas version
1168+
isna : top-level isna
1169+
isnull : alias of isna
11691170
Categorical.notna : boolean inverse of Categorical.isna
11701171
11711172
"""
@@ -1183,7 +1184,7 @@ def isna(self):
11831184

11841185
def notna(self):
11851186
"""
1186-
Reverse of isna
1187+
Inverse of isna
11871188
11881189
Both missing values (-1 in .codes) and NA as a category are detected as
11891190
null.
@@ -1194,7 +1195,8 @@ def notna(self):
11941195
11951196
See also
11961197
--------
1197-
notna : pandas version
1198+
notna : top-level notna
1199+
notnull : alias of notna
11981200
Categorical.isna : boolean inverse of Categorical.notna
11991201
12001202
"""

pandas/core/dtypes/missing.py

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def isna(obj):
4040
See also
4141
--------
4242
pandas.notna: boolean inverse of pandas.isna
43+
pandas.isnull: alias of isna
4344
"""
4445
return _isna(obj)
4546

@@ -206,6 +207,7 @@ def notna(obj):
206207
See also
207208
--------
208209
pandas.isna : boolean inverse of pandas.notna
210+
pandas.notnull : alias of notna
209211
"""
210212
res = isna(obj)
211213
if is_scalar(res):

pandas/core/frame.py

+16
Original file line numberDiff line numberDiff line change
@@ -3205,6 +3205,22 @@ def _maybe_casted_values(index, labels=None):
32053205
# ----------------------------------------------------------------------
32063206
# Reindex-based selection methods
32073207

3208+
@Appender(_shared_docs['isna'] % _shared_doc_kwargs)
3209+
def isna(self):
3210+
return super(DataFrame, self).isna()
3211+
3212+
@Appender(_shared_docs['isna'] % _shared_doc_kwargs)
3213+
def isnull(self):
3214+
return super(DataFrame, self).isnull()
3215+
3216+
@Appender(_shared_docs['isna'] % _shared_doc_kwargs)
3217+
def notna(self):
3218+
return super(DataFrame, self).notna()
3219+
3220+
@Appender(_shared_docs['notna'] % _shared_doc_kwargs)
3221+
def notnull(self):
3222+
return super(DataFrame, self).notnull()
3223+
32083224
def dropna(self, axis=0, how='any', thresh=None, subset=None,
32093225
inplace=False):
32103226
"""

pandas/core/generic.py

+16-6
Original file line numberDiff line numberDiff line change
@@ -4456,27 +4456,37 @@ def asof(self, where, subset=None):
44564456
44574457
See Also
44584458
--------
4459-
notna : boolean inverse of isna
4459+
%(klass)s.notna : boolean inverse of isna
4460+
%(klass)s.isnull : alias of isna
4461+
isna : top-level isna
44604462
"""
44614463

4462-
@Appender(_shared_docs['isna'])
4464+
@Appender(_shared_docs['isna'] % _shared_doc_kwargs)
44634465
def isna(self):
44644466
return isna(self).__finalize__(self)
4465-
isnull = isna
4467+
4468+
@Appender(_shared_docs['isna'] % _shared_doc_kwargs)
4469+
def isnull(self):
4470+
return isna(self).__finalize__(self)
44664471

44674472
_shared_docs['notna'] = """
44684473
Return a boolean same-sized object indicating if the values are
44694474
not na.
44704475
44714476
See Also
44724477
--------
4473-
isna : boolean inverse of notna
4478+
%(klass)s.isna : boolean inverse of notna
4479+
%(klass)s.notnull : alias of notna
4480+
notna : top-level notna
44744481
"""
44754482

4476-
@Appender(_shared_docs['notna'])
4483+
@Appender(_shared_docs['notna'] % _shared_doc_kwargs)
44774484
def notna(self):
44784485
return notna(self).__finalize__(self)
4479-
notnull = notna
4486+
4487+
@Appender(_shared_docs['notna'] % _shared_doc_kwargs)
4488+
def notnull(self):
4489+
return notna(self).__finalize__(self)
44804490

44814491
def _clip_with_scalar(self, lower, upper, inplace=False):
44824492
if ((lower is not None and np.any(isna(lower))) or

pandas/core/indexes/base.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1856,14 +1856,15 @@ def isna(self):
18561856
18571857
See also
18581858
--------
1859-
pandas.isna : pandas version
1859+
isnull : alias of isna
1860+
pandas.isna : top-level isna
18601861
"""
18611862
return self._isnan
18621863
isnull = isna
18631864

18641865
def notna(self):
18651866
"""
1866-
Reverse of isna
1867+
Inverse of isna
18671868
18681869
.. versionadded:: 0.20.0
18691870
@@ -1873,7 +1874,8 @@ def notna(self):
18731874
18741875
See also
18751876
--------
1876-
pandas.notna : pandas version
1877+
notnull : alias of notna
1878+
pandas.notna : top-level notna
18771879
"""
18781880
return ~self.isna()
18791881
notnull = notna

pandas/core/series.py

+16
Original file line numberDiff line numberDiff line change
@@ -2784,6 +2784,22 @@ def to_excel(self, excel_writer, sheet_name='Sheet1', na_rep='',
27842784
merge_cells=merge_cells, encoding=encoding,
27852785
inf_rep=inf_rep, verbose=verbose)
27862786

2787+
@Appender(generic._shared_docs['isna'] % _shared_doc_kwargs)
2788+
def isna(self):
2789+
return super(Series, self).isna()
2790+
2791+
@Appender(generic._shared_docs['isna'] % _shared_doc_kwargs)
2792+
def isnull(self):
2793+
return super(Series, self).isnull()
2794+
2795+
@Appender(generic._shared_docs['isna'] % _shared_doc_kwargs)
2796+
def notna(self):
2797+
return super(Series, self).notna()
2798+
2799+
@Appender(generic._shared_docs['notna'] % _shared_doc_kwargs)
2800+
def notnull(self):
2801+
return super(Series, self).notnull()
2802+
27872803
def dropna(self, axis=0, inplace=False, **kwargs):
27882804
"""
27892805
Return Series without null values

0 commit comments

Comments
 (0)