-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fix rolling median and quantile with closed='left' and closed='neither' (#26005) #26910
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
Adding the first element at setup produce incorrect results when closed option is left or neither. Instead iterating from first start to end at setup is a proper option same as in roll_mean
When a window is empty actual element in the order of window is removed from skiplist. But since it is added after removing it is never removed and remains in the skiplist. Instead removing after adding is a proper option
Thank @ihsansecer. It looks like #26005 reported multiple issues. Do your changes fix the memory skiplist issues? If so, can you add tests / release note? Otherwise, edit the original post to remove the "closes", so that it remains open. cc @WillAyd |
Codecov Report
@@ Coverage Diff @@
## master #26910 +/- ##
==========================================
- Coverage 91.97% 91.97% -0.01%
==========================================
Files 180 180
Lines 50756 50760 +4
==========================================
Hits 46685 46685
- Misses 4071 4075 +4
Continue to review full report at Codecov.
|
@TomAugspurger not yet checked issues with memory skiplist and |
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.
comments
It seems |
yep, can you merge master and push again here. |
@jreback Merged and changed |
thanks @ihsansecer nice patch! |
median
(and alsoquantile
)closed='left'
andclosed='neither'
in offset-based rolling window, multiple issues with closed='left' #26005git diff upstream/master -u -- "*.py" | flake8 --diff
Here is my understanding of how it should work:
*Same as test cases, there is one day between each element and window size is 3 days.
For
closed='both'
(() denotes Nth window and - is just to state window is out of ):For
closed='right'
:For
closed='left'
:For
closed='neither'
: