-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: add Index.dropna #13791
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
ENH: add Index.dropna #13791
Conversation
@@ -323,6 +323,22 @@ Other enhancements | |||
index=['row1', 'row2']) | |||
df.sort_values(by='row2', axis=1) | |||
|
|||
- ``Index`` now supports ``.dropna`` to exclude missing values (:issue:`6194`) |
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.
make a sub section I think (and maybe roll some other API changes there from Index eg where) might be others
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 separate subsection. is fine too
whatever is more clear
Current coverage is 85.24% (diff: 100%)@@ master #13791 diff @@
==========================================
Files 140 140
Lines 50420 50438 +18
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 42975 42998 +23
+ Misses 7445 7440 -5
Partials 0 0
|
idx.dropna() | ||
|
||
For ``MultiIndex``, values are dropped if any level is missing by default. Specifying | ||
``how='all'`` drops values to all levels are missing. |
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.
" drops values to all levels are missing." -> "only drops values where all levels are missing"
Two minor comments, looks good to me for the rest! |
Thanks, made changes for that were pointed out. Added |
midx.dropna(how='all') | ||
|
||
- ``Index.astype()`` now accepts an optional boolean argument ``copy``, which allows optional copying if the requirements on dtype are satisfied (:issue:`13209`) | ||
- ``Index`` now supports ``.str.extractall()`` which returns a ``DataFrame``, the see :ref:`docs here <text.extractall>` (:issue:`10008`, :issue:`13156`) |
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.
nice
thanks @sinhrks |
git diff upstream/master | flake8 --diff
after this PR:
MI has option
how
to drop if any/all levels are NA (the same asDataFrame
)