-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
API: Make .shift always copy (Fixes #22397) #22517
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
Changes from 5 commits
4950201
afeb4d6
ec6fb2b
6b022fd
98e797a
c724461
43d9f07
8b67c1f
8d2fc41
2b607ac
04a8822
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,3 +227,9 @@ def test_valid_deprecated(self): | |
# GH18800 | ||
with tm.assert_produces_warning(FutureWarning): | ||
pd.Series([]).valid() | ||
|
||
def test_shift_always_copy(self): | ||
# GH22397 | ||
s = Series([1, 2, 3]) | ||
assert s.shift(0) is not s | ||
assert s.shift(1) is not s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we parametrize this? (I know it's only two examples, but why not three for example?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems fine to be as is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
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 u also test for datetime types
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.
Done (assuming DatetimeIndex was meant, which required another fix) if you just meant a series of datetimes, will change - let me know