-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: value_counts can handle the case even with empty groups (#28479) #28634
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
…dev#28479) * If applying rep to recons_labels go fail, use ids which has no consecutive duplicates instead.
Sorry for the second commit... Can it be squashed..? |
@0xF4D3C0D3 FYI you don't need to create a new PR, you can simply rebase and push to the existing one (leave this as its already done) |
@jreback Thanks for your advice, I just worried that if I had committed something like a trivial typo, it would have made the history of main repo dirty. So for the sake of only one commit, I checkout with another branch and commit with a random message and |
yes you can do whatever you want, including merges & rebases on a branch; on merge we will squash to a single commit. |
Wow, that's cool! sorry for my inexperience D: |
1. remove the seed 2. remove meaningless comment 3. refer to GH issue number
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.
are there any perf implications here? e.g. show the run of the groupby asvs
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. pls merge master and ping on green.
thanks @0xF4D3C0D3 |
consecutive duplicates instead.
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
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 ofGrouper
is too long so that it has empty groups in some periods then it crashes. And also have found that this is solved by usingids
which has no consecutive duplicates instead ofself.grouper.recons_labels
.