Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
groupby filtering is missing some groups #7870
Comments
cpcloud
added Bug Groupby
labels
Jul 29, 2014
cpcloud
added this to the
0.15.0
milestone
Jul 29, 2014
|
I'm not sure this is what If I'm right, then the bug is that this isn't tripping |
|
I'll repost how I thought it might've worked
|
|
@dsm054 by groups do you mean |
|
I agree with @dsm054 here. This should return the SAME df, (as 'best' is in EACH group). The bug is that the complete groups are not being returned (because the filter function is tricking the detector). |
|
I mean the subframes that The example in the function itself is |
|
well then this is very weird :) |
|
pr coming |
|
Just to be clear, I'm not sure I agree with @jreback that the right thing to do is to return the same |
|
Posted on ML before this. I think raise is the correct course of action here. Filter is for removing/including entire groups. Picking all or any (or first!) of the boolean Series would be strange IMO...
|
phobson
commented
Jul 29, 2014
|
Very insightful comments here. Much appreciated. I'm |
|
I concur |
|
Okay, this mainly had to do with the
gives two different unrelated results and there were some hacks around trying to figure out which one was "correct". i gutted all that code and now just call the fast path, we'll see what happens on travis but this doesn't break anything locally. |
cpcloud
referenced
this issue
Jul 29, 2014
Merged
BUG/FIX: groupby should raise on multi-valued filter #7871
cpcloud
self-assigned this
Jul 29, 2014
|
I went with raise for the same reason that |
phobson commentedJul 29, 2014
I brought this up on the mailing list. @cpcloud modified my example into very concise sample showing expected and resulting output: