-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: GroupBy.quantile
implicitly sorts index.levels
#53049
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
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.
Thanks for the PR! Lookng good - some small requests.
- not sure but I think it is not checking index levels like this
…/pandas into grpby-quantile-lvls
Hi @rhshadrach, thanks for your review! I've updated the changelog and the tests as you suggested. However, I'm not sure if qind = pd.MultiIndex(
[["A", "B"], [0.2, 0.8]],
[[1, 1, 0, 0], [0, 1, 0, 1]],
names=["cat1", None],
) and it still passed the test. Is there any recommended way of fixing this? |
Thanks for identifying this @Charlie-XIAO - I opened #53095. For this PR, I think it'd be good to keep the assert_series_equal, and assert the index levels as you had it. |
Thanks @rhshadrach! I've retrieved the index levels check. |
Thanks for your review @rhshadrach! I've pushed the changes that avoid performance regression when |
Yes! It looks to me like these two blocks can now be largely combined. |
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.
lgtm
Thanks @Charlie-XIAO |
…3049) * fixed groupby quantile index.levels * changelog added * updated changelog * modified test to test whole frame - not sure but I think it is not checking index levels like this * updated tests to check index levels separately * avoid performance regression when not multiindex * tried to combine code blocks
…3049) * fixed groupby quantile index.levels * changelog added * updated changelog * modified test to test whole frame - not sure but I think it is not checking index levels like this * updated tests to check index levels separately * avoid performance regression when not multiindex * tried to combine code blocks
doc/source/whatsnew/v2.1.0.rst
file