-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Cumulative Methods with mixed frames casts to object #19296
Comments
cc @jbrockmendel this may interest you. |
Looks like the casting is done in I'd be down for working towards making these apply block-wise, avoid some casting (and likely copying). |
Cool, thanks. This of course came up in the context of the extension array / block stuff. We need some kind of way of knowing
|
So I should check an implicit assumption I've been making: does your game-plan involve the Block subclasses inheriting from analogous Array subclasses? The problem posed would be simpler if the method lookup can be done at the Block level, with the implementation at the Array level. I've been leaving the DataFrame case for last so I wouldn't have to figure out the dispatching logic. Between |
these should be dispatched like all other operations using BlockManager.apply. e.g. look up |
don't label things for 0.23 until they are actually merged. |
@TomAugspurger side-note question w.r.t Categoricals: Series arithmetic methods are defined in core.ops:
The |
Looks like we cast the entire frame to object dtype, and then perform the cumulative functions:
I think it'd be better to do these block-wise? The possible downside I see is that
Will now be slower (presumably) since we'll have two cumsums to apply instead of one (after upcasting), but I think that'd be worth it for preserving the correct dtypes.
The text was updated successfully, but these errors were encountered: