-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: Series.compress #21930
DEPR: Series.compress #21930
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21930 +/- ##
==========================================
+ Coverage 92% 92% +<.01%
==========================================
Files 170 170
Lines 50609 50611 +2
==========================================
+ Hits 46561 46563 +2
Misses 4048 4048
Continue to review full report at Codecov.
|
doc/source/whatsnew/v0.24.0.txt
Outdated
@@ -314,7 +314,7 @@ Deprecations | |||
- :meth:`DataFrame.to_stata`, :meth:`read_stata`, :class:`StataReader` and :class:`StataWriter` have deprecated the ``encoding`` argument. The encoding of a Stata dta file is determined by the file type and cannot be changed (:issue:`21244`). | |||
- :meth:`MultiIndex.to_hierarchical` is deprecated and will be removed in a future version (:issue:`21613`) | |||
- :meth:`Series.ptp` is deprecated. Use ``numpy.ptp`` instead (:issue:`21614`) | |||
- | |||
- :meth:`Series.compress` is deprecated. Use ``Series.__getitem__`` instead (:issue:`18262`) |
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.
I prefer what you said in the warning message, which is to use Series[condition]
instead (more end-user friendly IMO vs. Series.__getitem__
).
comment by @gfyoung but otherwise, merge away. |
thanks @TomAugspurger |
One problem with this PR is that now
so apparently Is there something to do about that? (I suppose not?) |
Additional problem is that once we remove the method, You get something like (with the method commented out):
which is not a very user friendly error message .. Of course, if we are fine with |
How about we update the warning message to be Use `series[condition] or np.asarray(series).compress(condition)` |
xref #18262