-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: update the isna, isnull, notna and notnull docstring #20459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
e9640fb
8ea572e
0c33a43
85fe9b8
89e45c4
eb38aef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,12 @@ | |
|
||
|
||
def isna(obj): | ||
"""Detect missing values (NaN in numeric arrays, None/NaN in object arrays) | ||
"""Detect missing values for an array | ||
|
||
This function takes an array-like object, for each element, if it is | ||
a missing value (NaN in numeric arrays, None/NaN in object arrays) | ||
the correisponding element of the output boolean array will be true, | ||
otherwise false. | ||
|
||
Parameters | ||
---------- | ||
|
@@ -46,6 +51,18 @@ def isna(obj): | |
-------- | ||
pandas.notna: boolean inverse of pandas.isna | ||
pandas.isnull: alias of isna | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add Series.isna, DataFrame.isna, and Index.isna. |
||
Examples | ||
-------- | ||
>>> df = pd.DataFrame([[1, pd.np.nan, 3], [4, 5, pd.np.nan]]) | ||
>>> df | ||
0 1 2 | ||
0 1 NaN 3.0 | ||
1 4 5.0 NaN | ||
>>> pd.isna(df) | ||
0 1 2 | ||
0 False True False | ||
1 False False True | ||
""" | ||
return _isna(obj) | ||
|
||
|
@@ -200,6 +217,11 @@ def notna(obj): | |
"""Replacement for numpy.isfinite / -numpy.isnan which is suitable for use | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you shorten this to a single line? Can be similar to you docstring for |
||
on object arrays. | ||
|
||
This function takes an array-like object, for each element, if it is *not* | ||
a missing.value (NaN in numeric arrays, None/NaN in object arrays) the | ||
correisponding element of the output boolean array will be true, | ||
otherwise false. | ||
|
||
Parameters | ||
---------- | ||
arr : ndarray or object value | ||
|
@@ -215,6 +237,18 @@ def notna(obj): | |
-------- | ||
pandas.isna : boolean inverse of pandas.notna | ||
pandas.notnull : alias of notna | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add Series.notna, DataFrame.notna, and Index.notna |
||
Examples | ||
-------- | ||
>>> df = pd.DataFrame([[1, pd.np.nan, 3], [4, 5, pd.np.nan]]) | ||
>>> df | ||
0 1 2 | ||
0 1 NaN 3.0 | ||
1 4 5.0 NaN | ||
>>> pd.notna(df) | ||
0 1 2 | ||
0 True False True | ||
1 True True False | ||
""" | ||
res = isna(obj) | ||
if is_scalar(res): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End with a
.