-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Make Series.shift always a copy? #22397
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
Labels
Milestone
Comments
What if we disallowed shifting by zero? Seems like a useless argument for this function anyway |
Special casing edge cases seems to always end up biting us in the end. Since a length-0 shift is well-defined, I'd prefer to just allow it. |
Fair enough - in that case I'm +1 on always copy |
4 tasks
jreback
pushed a commit
that referenced
this issue
Sep 15, 2018
aeltanawy
pushed a commit
to aeltanawy/pandas
that referenced
this issue
Sep 20, 2018
Sup3rGeo
pushed a commit
to Sup3rGeo/pandas
that referenced
this issue
Oct 1, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now,
Series.shift(0)
will just return the series. Shifting for all other periods induces a copy:Should we defensively copy on
0
as well, for a consistent user experience?pandas/pandas/core/generic.py
Lines 8084 to 8086 in e669fae
The text was updated successfully, but these errors were encountered: