-
-
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
[ArrayManager] Array version of interpolate logic #44736
[ArrayManager] Array version of interpolate logic #44736
Conversation
pandas/core/missing.py
Outdated
**kwargs, | ||
) | ||
|
||
return _maybe_downcast(interp_values, downcast) |
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.
can this be done in the Manager method?
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.
This is logic that belongs in the interpolate
function? (for putting this in the manager, I would need to create a small wrapper function that combines the above method with _maybe_downcast
to use in ArrayManager.apply
. I don't really see an advantage of that)
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.
Not a huge deal. My thought is that post-op downcasting is likely to be the part where AM/BM are different, so putting the logic in the AM/BM method is more likely to be conducive to sharing.
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.
I don't think that downcasting logic is different at the moment?
Can any of this be shared with the Block method? |
I think the actual interpolate function is already shared (i.e. |
I increasingly think that this type of change should be left until right before BlockManager is ripped out. Until then, this just duplicates code and makes it easy for behavior to accidentally drift apart. |
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen. |
Similar to what I did in #41104 for
fillna
(xref #39146).This also improves the performance for some of the fillna/interpolate benchmarks (mostly due to avoiding the overhead of creating a block for each column). For example (from
frame_methods.Fillna.time_frame_fillna(True, 'bfill', 'datetime64[ns]')
: