-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
REGR: fix DataFrame reduction with EA columns and numeric_only=True #33761
REGR: fix DataFrame reduction with EA columns and numeric_only=True #33761
Conversation
return op(values, axis=0, skipna=skipna, **kwds) | ||
return op(values, axis=1, skipna=skipna, **kwds) | ||
if isinstance(values, ExtensionArray): | ||
return values._reduce(name, skipna=skipna, **kwds) |
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.
is _reduce part of the interface?
if we're avoiding nanops, can/should we make those functions either a) not handle EA cases or b) dispatch to _reduce?
yes (and the default is to raise an error saying the reduction is not supported)
Since Of course, we could also decide on always calling nanops, and putting the logic to call |
More comments on this? (apart from that I need to rebase + fix the tests (update error message match)) |
seems ok to me |
ill take another look once rebased+green, but tentatively looks good |
Updated on master |
(travis failure is an unrelated URLError connection error in test_read_from_http_url) |
LGTM |
xref #33300 to track. |
…uction with EA columns and numeric_only=True)
…h EA columns and numeric_only=True) (#34000) Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Closes #33256
For the block-wise path in
DataFrame._reduce
, we ensure to use the EA reduction for blocks holding EAs, instead of passing the EA to theop
function (which is typically thenanops
nan function).This needs #33758 to be merged, since that PR fixes the test that is failing here.