Skip to content

BUG: Bug in quantile() and median() returned wrong result for non monotonic window borders #37166

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

Merged
merged 9 commits into from
Oct 30, 2020

Conversation

phofl
Copy link
Member

@phofl phofl commented Oct 16, 2020

cc @mroeschke

Values were not added to the window again if starting point was moved back and values were not removed from the window, when ending point was moved back

Should I create functions for the deletion and addition?

@mroeschke
Copy link
Member

Yeah would be great to create a function that median and quantile could share for the skiplist inserts and removal

@phofl
Copy link
Member Author

phofl commented Oct 16, 2020

Should we move the for the for j in range(s, e): blocks into the function too? Would be differing from the other parts, but otherwise the assignment of err is a bit long winded

@mroeschke
Copy link
Member

Hmm if it makes the code more DRY then sure.

@jreback jreback added the Window rolling, ewma, expanding label Oct 16, 2020
@jreback
Copy link
Contributor

jreback commented Oct 16, 2020

this is orthogonal to #36933 ?

@mroeschke
Copy link
Member

this is orthogonal to #36933 ?

Yes, median and quantile are slightly different from sum/mean/var

@phofl
Copy link
Member Author

phofl commented Oct 16, 2020

We can use is_monotonic_start_end_bounds here too nevertheless. Did miss that previously. I would rename the function after #36933 is merged.

@mroeschke
Copy link
Member

Mind merging in master? #36933 was recently pulled in (but shouldn't directly interfere)

@phofl
Copy link
Member Author

phofl commented Oct 25, 2020

Thanks for the heads up. Had to rename the method, but this was expected. I think this could be merged now.

@mroeschke
Copy link
Member

Appears that there's another merge conflict.

@mroeschke mroeschke added this to the 1.2 milestone Oct 30, 2020
@mroeschke mroeschke merged commit 5a45c0d into pandas-dev:master Oct 30, 2020
@mroeschke
Copy link
Member

Thanks @phofl

@phofl phofl deleted the 37153 branch October 30, 2020 23:17
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
…otonic window borders (pandas-dev#37166)

* BUG: Bug in quantile() and median() returned wrong result for non monotonic window borders

* Adjust whatsnew

* Use is monotonic instead

* Remove unncecessary code

* Remove unncecessary code

* Rename function after related pr was merged
ukarroum pushed a commit to ukarroum/pandas that referenced this pull request Nov 2, 2020
…otonic window borders (pandas-dev#37166)

* BUG: Bug in quantile() and median() returned wrong result for non monotonic window borders

* Adjust whatsnew

* Use is monotonic instead

* Remove unncecessary code

* Remove unncecessary code

* Rename function after related pr was merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: rolling.median/quantile does not work with (some) BaseIndexer subclasses
3 participants