Skip to content

Commit 2cb94d8

Browse files
committed
depr slice_shift
1 parent 337bf20 commit 2cb94d8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/core/generic.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9351,6 +9351,9 @@ def slice_shift(self: FrameOrSeries, periods: int = 1, axis=0) -> FrameOrSeries:
93519351
The shifted data will not include the dropped periods and the
93529352
shifted axis will be smaller than the original.
93539353
9354+
.. deprecated:: 1.2.0
9355+
slice_shift is deprecated, use DataFrame/Series.shift instead.
9356+
93549357
Parameters
93559358
----------
93569359
periods : int
@@ -9365,6 +9368,14 @@ def slice_shift(self: FrameOrSeries, periods: int = 1, axis=0) -> FrameOrSeries:
93659368
While the `slice_shift` is faster than `shift`, you may pay for it
93669369
later during alignment.
93679370
"""
9371+
9372+
msg = (
9373+
"The 'slice_shift' method is deprecated "
9374+
"and will be removed in a future version. "
9375+
"You can use DataFrame/Series.shift instead"
9376+
)
9377+
warnings.warn(msg, FutureWarning, stacklevel=2)
9378+
93689379
if periods == 0:
93699380
return self
93709381

0 commit comments

Comments
 (0)