-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: Panel.shift vs 0.13.1 #6826
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
Moved from PR thread So thinking about this. Is there a reason that this logic wouldn't also apply to
I suppose one could assume that iirc, the reason we don't just take a slice for DataFrame is that it just defers work to later realignment. Would be nice if numpy could understand a logical array consisting of multiple physical ones, in our case the shifted data + na data. I'm going to poke at returning view slices for DataFrame.shift, but that's probably a no go since anything that doesn't use |
http://nbviewer.ipython.org/gist/dalejung/10013405
While the slice shifting is fast in itself, it ends up costing more due to reindexing. So in a sense, we pay a higher price for deferring since the |
I agree realiagnment is expensive, BUT I think if we can return a view it is better to delay that penalty (as it might not be paid, e.g. if you are indexing or something). Did the previous impl do soemthing different? |
The previous Panel shift just took that view slice. DataFrame shift always returned a copy. I'm going to make a general view_shift and switch Panels to use that. Then afterwards explore the implications of switching DataFrame.shift. I think that might be a no go because of backwards compat, but it'll probably lead to some fast past in the Might be not hit this for a few days but the reverting itself will be straight forward. |
ok thanks pls update when u r ready |
@dalejung update on this? |
@jreback I'll either push out the above or just a simple reversal shortly. Both paths are straight-forward. Dog had back surgery so I've been pre-occupied. She's fine but needs sling-walking every 2-3 hours 24/7 due to steroids. |
ahh...hope dog feels better! I hear ya ok....lmk when ready |
…#6826 TST: Make sure Panel.shift retains dtypes DOC: removed previous doc entries for pandas-dev#6605 Re-add note about dropping shifted periods DOC: added note about bug fix don't pass on freq
closed by #6974 |
related: #6605
The text was updated successfully, but these errors were encountered: