-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Update the pandas.Index.isna docstring #20123
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
DOC: Update the pandas.Index.isna docstring #20123
Conversation
pandas/core/indexes/base.py
Outdated
|
||
Examples | ||
-------- | ||
Show which entries in a pandas.Index are NA. The result is a |
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.
a -> an. array to numpy.ndarray
.
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.
We left it as 'array', because you can see the data type in the returns section (recommended as more user friendly by @jorisvandenbossche )
pandas/core/indexes/base.py
Outdated
>>> idx.isna() | ||
array([False, False, True]) | ||
|
||
Empty strings are not considered NA values. None is considered a NA |
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.
a -> an.
Just a couple minor grammar things, otherwise this LGTM. |
Fixed grammar
pandas/core/indexes/base.py
Outdated
Detect missing values. | ||
|
||
Return a boolean same-sized object indicating if the values are NA. | ||
NA values, such as None or :attr:`numpy.NaN`, get mapped to True |
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.
or pd.NaT
pandas/core/indexes/base.py
Outdated
isnull : alias of isna | ||
pandas.Index.isnull : alias of isna | ||
pandas.Index.notna : boolean inverse of isna | ||
pandas.Index.dropna : omit entries with missing values |
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.
add Series.isna
pandas/core/indexes/base.py
Outdated
|
||
See also | ||
-------- | ||
isnull : alias of isna | ||
pandas.Index.isnull : alias of isna |
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.
could say this is a synonym
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.
Not my native language, I went with the language that was originally used. I can change it across all docs we have commited fi you'd like to, @jreback . Y/N?
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.
oh sorry, yes alias is fine.
Empty strings are not considered NA values. None is considered an NA | ||
value. | ||
|
||
>>> idx = pd.Index(['black', '', 'red', None]) |
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.
can you show a datetimeindex example (with has a NaT)
Codecov Report
@@ Coverage Diff @@
## master #20123 +/- ##
=========================================
Coverage ? 91.7%
=========================================
Files ? 150
Lines ? 49152
Branches ? 0
=========================================
Hits ? 45074
Misses ? 4078
Partials ? 0
Continue to review full report at Codecov.
|
Thanks @Donk23! |
Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):
scripts/validate_docstrings.py <your-function-or-method>
git diff upstream/master -u -- "*.py" | flake8 --diff
python doc/make.py --single <your-function-or-method>