-
-
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
API/BUG: center=True in expanding operations returns non-sensical results #20647
Comments
Hmm, I see that we in the past removed the |
yes center doesn’t make sense in context of expanding |
I'd like to work on this |
Go for it! No need to ask for permission unless someone else is working on it. |
Is anyone still working on this? |
I don't think so (unless @stillmatic did work on it? If you do, best to say so on this issue), so feel free to take a look at it! |
i started working on this issue but don't think my solution is correct/finished. Haven't had time to finish (there are many dependencies). If you have a good idea go ahead, otherwise I might be able to find time and get this done |
@stillmatic in the commit you removed @jorisvandenbossche I believe in this example center should do nothing if it's supposed to be consistent with functionality of When setting center=True, the result is placed at the index of element in center of the window (index in window / 2), effectively shifting the results back.
In terms of whether it's actually useful for |
take |
It seems like Combined with the current output simply being wrong, I think that means we can move forward with deprecating |
take |
What is
center=True
supposed to do indf.expanding()...
operations?Using the example from the docstring of
.expanding()
:Now adding
center=True
:Two observations: it seems it just shifted the first rows (which is not the same as centering) and I don't know where the last values are coming from (and they should certainly not decrease again in an expanding sum with only positive values).
Further, I also cannot think of what it actually should do. If we really want to center it, that would mean returning with a new index (as the real center would only increase with 0.5 and be something like [0, 0.5, 1, 1.5, 2] for those data).
So maybe we should rather remove this keyword for
expanding
?The text was updated successfully, but these errors were encountered: