Skip to content

BUG: value_counts can handle the case even with empty groups (#28479) #28607

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 2 commits into from

Conversation

dongho-jung
Copy link
Contributor

  • If applying rep to recons_labels go fail, use ids which has no
    consecutive duplicates instead.

xuancong84 found that value_counts() crashes if groupby object contains empty groups.
However, even though I made the construction of DataFrame don't skip empty rows, it still crashed.
Till then, I already tried in many ways though, in this time I tried to correct the callee self.grouper.recons_labels. After several tests, I found that If freq of Grouper is too long so that it has empty groups in some periods then it crashes. And also have found that this is solved by using ids which has no consecutive duplicates instead of self.grouper.recons_labels.

@pep8speaks
Copy link

Hello @0xF4D3C0D3! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 83:1: E302 expected 2 blank lines, found 1
Line 106:1: W391 blank line at end of file

@dongho-jung
Copy link
Contributor Author

I'm sorry. I'll issue PR later again because I made some mistakes

@dongho-jung dongho-jung deleted the fix-GH28479-4 branch September 25, 2019 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

value_counts() crashes if groupby object contains empty groups
2 participants