-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: Dispatch mechanism for EA reductions #33790
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
Comments
So some questions we need to discuss on this topic:
|
This is different that what we have now (we look for an override method first in This pattern is very similar to what we do elsewhere (e.g. we mostly dispatch to nanops to do the actual computation with Series / Index level methods). |
Although I think it is a good idea to implement those numpy protocols for compatibility, I am not fully sure if we can actually use it internally, since we have additional keywords compared to numpy (skipna, min_count). Having something similar as |
#44442 added a cast because BooleanArray does not currently have a |
We now have a basic ExtensionArray._reduce method and both Series._reduce and DataFrame._reduce dispatch to it. Closing. |
#33538 implemented sum as a standalone method for IntegerArray which somewhat duplicates the already-existing _reduce path taken by DataFrame / Series for certain reductions (see #33538 (review)). Likely it makes sense to implement these at the IntegerArray / BooleanArray / etc. level using that same approach, e.g., something like defining each reduction to simply call _reduce with the appropriate operation name instead of copy / pasting the logic into each method.
The text was updated successfully, but these errors were encountered: