-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: GH10355 groupby std() doesnt sqrt grouping cols #11507
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
Previously, grouping columns were square rooted when as_index=False We now test whether the grouping keys are in the columns, and if so don't square root those columns. Note that we squash TypeError which occurs when self.keys is not Hashable and so we can't check for existence in columns.
return np.sqrt(self.var(ddof=ddof)) | ||
else: | ||
df = self.var(ddof=ddof) | ||
|
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.
you don't need all of this logic, just use self._selected_obj
pls add a whatsnew note in 0.17.1 bug-fixes |
My if tests logic finds columns used to make the group. This is to ensure their values are not square rooted. |
these |
Thanks for your quick reply. As you can see in your output on line [23] _selected_obj doesn't exclude the grouping when as_index=False Sorry if I'm missing something. |
use this, though maybe something more sophisticated in there. you have to test using levels as well. Everything is there in the grouper objects, you just have to look for it. Don't reinvent the wheel.
|
pls rebase / update according to comments |
can you rebase / update according to comments |
can you update? |
can you update |
closing. but pls reopen if you'd like to update |
New attempt at #10355 Hopefully should address the issues raised in #11300
Previously, grouping columns were square rooted when as_index=False
We now test whether the grouping keys are in the columns, and
if so don't square root those columns.
Note that we squash TypeError which occurs when self.keys is not
Hashable, and so we can't check for existence in columns.