-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Debug grouped quantile with NA values #33571
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
expected = pd.DataFrame( | ||
[1.0, 3.0], index=pd.Index([1.0, 3.0], name="key"), columns=["val"] |
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.
I'm pretty sure this test was wrong, the values for the non-null labels are 0 and 2, so these quantiles don't make sense
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.
xref #29173 (comment)
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 taking a look
order = (values, labels) | ||
# Get an index of values sorted by labels and then values, | ||
# make sure missing labels sort to the back of the array | ||
if labels.size: |
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.
Does the subsequent loop even account for missing labels in iteration? If not I wonder if cleaner to just remove rather than force sorting this way
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.
Hmm, I think we'd also have to remove from values so that the two have the same shape for lexsort (that might break what's below but I'm not sure honestly)
Closing as this is basically identical to #33644 now |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff