Skip to content

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

Closed
wants to merge 8 commits into from
Closed

BUG: Debug grouped quantile with NA values #33571

wants to merge 8 commits into from

Conversation

dsaxton
Copy link
Member

@dsaxton dsaxton commented Apr 15, 2020

expected = pd.DataFrame(
[1.0, 3.0], index=pd.Index([1.0, 3.0], name="key"), columns=["val"]
Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@WillAyd WillAyd left a 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:
Copy link
Member

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

Copy link
Member Author

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)

@dsaxton
Copy link
Member Author

dsaxton commented May 4, 2020

Closing as this is basically identical to #33644 now

@dsaxton dsaxton closed this May 4, 2020
@dsaxton dsaxton deleted the groupby-quantile branch May 4, 2020 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: strange behaviour in quantile with group by
3 participants