-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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: let's deprecate #18262
Comments
cc @jorisvandenbossche @TomAugspurger if any comments / objections pls note and I will update the top section. |
I think I'm -1 on deprecating -0 on deprecating What's the alternative to |
I was just writing up a similar issue :-) (but only for Series, as by fixing the api docs and docstrings, I bumped into quite some methods unknown to me) Overview of methods that could be considered for removal (note that this list is very long, and are methods that I would not miss if they are gone, which does not mean that they are not useful to others, it's just for stirring discussion):
|
Note that my above list is very long. The more obvious ones to me that are not yet in the list in the top post are: |
Could The dataframe/Series namespace is huge and cutting down can make the API easier to grasp. I would also think it more logical and idiomatic to operate directly on the columns, rather than on the dataframe. |
@topper-123 added, feel free to submit PR's for any of these! |
@jorisvandenbossche @jreback I would love to submit PRs for this issue. How can I go about in deprecating these APIs? |
see for example #18258 |
@manrajgrover Best first post a comment here with which one you would start doing, as I think not all those listed above are uncontroversial. |
I think >>> s = pd.Series([0.2, 0.2, 0.2])
>>> s.compound() # essentialy the same as (s+1).cumprod() - 1
0 0.2000
1 0.440
2 0.728
dtype: float64 The above would play excellently together with any opinions if |
I've started a PR for I will take on And yes, I like to remove superfluous methods that start with |
Although I never use
|
@jorisvandenbossche I can start with
|
@jorisvandenbossche, what about removing a prefix/suffix or doing any other transformation you'd want to do on a index? My point is that I've already made a proposal for In the same vein, the difference between I'll make a PR for |
I completely agree with this. But, you also have the fact that people are using it and thus a removal will cause inconvenience / break code. So it is always a balance between both. I am certainly +1 on deprecating |
Here are my deprecation suggestions:
|
these are convenience methods, not sure they add much to API burden
this is a very common notion and is a very array-like method
this was just added for compat with |
|
@jreback There are only a total of 13 occurrences of
I guess there is no going back on @jorisvandenbossche I wasn't being clear, but all those DataFrame/Series methods that only work on DateTimeIndexes could be put in their own accesor (not .dt) but I don't think even that would be a good idea. Perhaps just deprecating all of them would be best. |
your suggestion is much less readable
sure, but isnull is even more entrenched than anything else. |
As indexing is simplified & improved, the speed diff between |
DataFrames have a method |
yes i think there is an issue about this |
The two methods aren’t quite equivalent iirc.
…________________________________
From: Jeff Reback <notifications@github.com>
Sent: Saturday, November 25, 2017 10:23:01 PM
To: pandas-dev/pandas
Cc: Tom Augspurger; Mention
Subject: Re: [pandas-dev/pandas] DEPR: let's deprecate (#18262)
yes i think there is an issue about this
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#18262 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABQHItMklrTp28DbdKXtQmYS9WIL_7sKks5s6NmVgaJpZM4Qb0GL>.
|
Why on earth would you deprecate |
One could argue why not deprecate Edit: |
|
cc @jbrockmendel here is my original list :-> |
Would it be possible to get a rationale to why .item() has been deprecated or a suggested alternative? I really appreciated this feature as it would assume one and only one match to a query/column combo. i.e Using the suggest next(iter, None)) feature as suggested in the link below is very readable, but breaks the assumption that there are not multiple matches to a query and returns only the first value, meaning I'd need to do add a check-query-length==1 prior to extracting the value. https://stackoverflow.com/questions/57390363/pandas-item-has-been-deprecated |
.unique() currently returns an ndarray so .item() would still be valid this is for .item() on Series (and Index) |
Thanks! I'll put in unique() to all pd.query("row_name=='var')[col_name] as a midfix to resolve the deprecation warning. |
Do we want to deprecate |
Appears that most of the functions described in the OP have been tackled. Further discussion on other specific APIs that should be deprecated would be better suited to individual issues. Closing for now. |
xref #18202
We have some cruft, let's deprecate it (I have noted some which already have an issue associated).
From ndarray
Series.compress()
(DEPR: Series.compress #21930)Series.imag
/Series.real
(DEPR: Series.put, Series.real, Series.imag, Index.dtype_str #27106)Series.nonzero()
(Deprecate series.nonzero (GH18262) #24048)Series.put()
(DEPR: Series.put, Series.real, Series.imag, Index.dtype_str #27106)Series.itemsize
Series.flags
Series.strides
timeseries specific
Series.first()
let head / tail take a timedelta
Series.last()
other
Series.swapaxes()
non-controversial
MultiIndex.to_hierarchical
(only used forPanel
) (DEPR: MultiIndex.to_hierarchical #21613)Series/DataFrame.compound()
(DEPR: deprecate Series/DataFrame.compound #26405)Series.ptp()
(DEPR: Series.ptp() #21614)Series.from_array
(Deprecate Series.from_array ? #18213)Series.valid()
(DEPR: Deprecate Series.valid #18800)Series/DataFrame.slice_shift()
(DEPR: DataFrame/Series.slice_shift #37601)Series/DataFrame.tshift()
(DEPR: Deprecate tshift and integrate it to shift #34545)Series/DataFrame.get_values()
(DEPR: .get_values() #19617)Index.dtype_str
(DEPR: Series.put, Series.real, Series.imag, Index.dtype_str #27106)Index.summary()
(Deprecate Index.summary #18217).get_ftype_counts
(DEPR: deprecate get_ftype_counts #18243) (DEPR: deprecate get_ftype_counts (GH18243) #20404).get_dtype_counts
DEPR: DataFrame.get_dtype_counts #27145Index/Series.asobject
(Deprecate Series.asobject, Index.asobject, rename to _asobject #18237) (DEPR: deprecate .asobject property #18572)Index.to_native_types()
(make private) (DEPR: Index.to_native_types #36418)DataFrame/Series.as_matrix
(DEPR: Deprecate NDFrame.as_matrix #18458).clip_upper/.clip_lower
(replace by.clip
) (DEPR: Deprecating .clip_lower and .clip_upper #24203)Potentially
.ftypes
(DEPR: deprecate get_ftype_counts #18243) (Deprecated Series.ftype, Series.ftypes and DataFrame.ftypes features #26744).xs()
(CLN: implement xs in terms of loc #6249).iat/.at
.take
.lookup
(DEPR: DataFrame.lookup #35224)DataFrame.from_items
(DEPR: deprecate .add_prefix and .add_suffix #18347)Series/DataFrame.add_prefix/add_suffix
NDFrame.filter
The text was updated successfully, but these errors were encountered: