-
Notifications
You must be signed in to change notification settings - Fork 901
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
Add support for axis=None in reductions #16229
base: branch-24.12
Are you sure you want to change the base?
Add support for axis=None in reductions #16229
Conversation
return getattr(concat_columns(source._data.columns), op)( | ||
**kwargs | ||
) | ||
elif axis == 2 and op in {"std", "var"}: |
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.
How should std and var reductions be treated? I think 1. is right, but I wanted to check.
- Combine the columns, then compute the reduction
- Compute the reduction over columns, then compute the reduction again over those results
cc. @mroeschke, @vyasr
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.
In regards to 1, we do have to keep this comment in mind: #14930 (comment)
In terms of correctness, I forgot if std and var validate the minimum number of elements in the columns, but if so, the logic for axis=None
should be something like.
if self.size < minimum_std_var_elements
: Return NAif len(self) < minimum_std_var_elements and self.size > minimum_std_var_elements
: Your option 1else
: Your option 2
TODO: Check if this is still relevant |
Description
Closes #12335
Checklist