Skip to content
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

DEPR: DataFrame dropna accepting multiple axes #20995

Merged
merged 4 commits into from
May 10, 2018

Conversation

kunalgosar
Copy link
Contributor

Deprecates multiple axes passing to dropna.

I added the whatsnew to 0.23.0 for now, I can move this to 0.24.0 later if preferred once the whatsnew doc is created.

@codecov
Copy link

codecov bot commented May 9, 2018

Codecov Report

Merging #20995 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #20995      +/-   ##
==========================================
+ Coverage   91.82%   91.82%   +<.01%     
==========================================
  Files         153      153              
  Lines       49488    49490       +2     
==========================================
+ Hits        45443    45445       +2     
  Misses       4045     4045
Flag Coverage Δ
#multiple 90.22% <100%> (ø) ⬆️
#single 41.85% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/frame.py 97.22% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eff1faf...43fe6ea. Read the comment docs.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Couple minor callouts on my end

@@ -1005,6 +1005,7 @@ Deprecations
- Setting ``PeriodIndex.freq`` (which was not guaranteed to work correctly) is deprecated. Use :meth:`PeriodIndex.asfreq` instead (:issue:`20678`)
- ``Index.get_duplicates()`` is deprecated and will be removed in a future version (:issue:`20239`)
- The previous default behavior of negative indices in ``Categorical.take`` is deprecated. In a future version it will change from meaning missing values to meaning positional indices from the right. The future behavior is consistent with :meth:`Series.take` (:issue:`20664`).
- Passing multiple axes to the ``axis`` parameter in :func: `DataFrame.dropna` has been deprecated and will not be suppoted in a future version (:issue:`20987`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo of "supported"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Determine if rows or columns which contain missing values are
removed.

* 0, or 'index' : Drop rows which contain missing values.
* 1, or 'columns' : Drop columns which contain missing value.

Pass tuple or list to drop on multiple axes.
deprecated:: 0.23.0: Pass tuple or list to drop on multiple axes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The directive should start with a ".. " here, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -4168,14 +4168,14 @@ def dropna(self, axis=0, how='any', thresh=None, subset=None,

Parameters
----------
axis : {0 or 'index', 1 or 'columns'}, or tuple/list thereof
axis : {0 or 'index', 1 or 'columns'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the standard for this is axis : {0 or ‘index’, 1 or ‘columns’, None}, default None

See end of pandas docstring guide section on Parameters:

https://python-sprints.github.io/pandas/guide/pandas_docstring.html#section-3-parameters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the default option here. dropna, however, does not support None as an input to axis.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm if that's the case then just go with axis : {0 or 'index', 1 or 'columns'}, default 0. That's what I see everywhere else in the code anyway

@datapythonista - something we should update in the docstring standard?

@kunalgosar
Copy link
Contributor Author

kunalgosar commented May 10, 2018

Thanks for the quick review @WillAyd! Resolved the comments above.

@jreback jreback added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Deprecate Functionality to remove in pandas labels May 10, 2018
@jreback jreback added this to the 0.23.0 milestone May 10, 2018
@jreback jreback merged commit 780b8d2 into pandas-dev:master May 10, 2018
@jreback
Copy link
Contributor

jreback commented May 10, 2018

thanks @kunalgosar and @WillAyd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPR: DataFrame dropna accepting multiple axes
3 participants