-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: deprecating series asof GH10343 #10345
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
Conversation
this is ok, but I think this could use a small doc-section in also will have to add a reference in the deprecate issue #6581 (will do this upon merging) |
@jreback I'd be happy to add it, but I'm not entirely sure what you're looking for here. I had a look through the missing_data.rst and there's no mention of asof to correct/update. Since it is a reindexing method, it's not clear how it should documented in the missing data section. |
@bwillers can you rebase? |
@jreback rebased and green |
DEPRECATED. Please use :meth:`Series.reindex` instead. | ||
|
||
So a `Series.asof(where)` can be replaced by | ||
`Series.dropna().reindex(where, method='ffil')`. |
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.
ffill
Can you put a mini-doc section right after here: http://pandas.pydata.org/pandas-docs/stable/timeseries.html#filling-forward-backward showing an |
If everyone thinks this is a good idea to deprecate, then so be it. I should say that we use this a lot, and find it a really convenient method. There are lots of use cases where you want to ask "what was the most recent valid value". And Am I missing something? Or are we just particular in our use case? |
@MaximilianR Well, the motivation here is mainly based on That said, The question becomes if the convenience of the shorter form for the specialized use case is worth the code bloat from multiple implementations of the same thing. I'm not personally convinced that it does, but that's definitely something worth discussing. |
@bwillers completely agree with that synthesis - i.e. the big question being how useful a method needs to be in order to compensate for the additional clutter. One point to consider for the specific case is how obvious that translation is for the average user. I'd have thought 'not very obvious', but I don't have a great handle on what the average current / future user looks like. If we do keep it, having it as a simple wrapper of the translation seems wise. Over to the maintainers on the broader question... |
As a reference, |
Note: I never used asof myself, so difficult to assess. We either deprecate it, or we keep it and see this as an opportunitiy to:
And maybe it would be useful to have some kind of |
@jorisvandenbossche That's not a bad idea - effectively 'replumb' the asof internals into reindex, but leave the compact and fairly intuitive api the same. |
@bwillers ok! |
ok, I revised the original issue. Let's try to reimplement this using |
@bwillers you can repurpose this PR or open a new one up to u |
@jreback sounds good, running around like a headless chicken this week but hope to get this done next. |
closes #10343 and discussion on #10266 - deprecating
Series.asof(where)
in favour ofSeries.reindex(where, method='ffill')
.