|
15 | 15 | from pandas.compat.numpy import function as nv
|
16 | 16 | from pandas.errors import (
|
17 | 17 | AbstractMethodError, NullFrequencyError, PerformanceWarning)
|
18 |
| -from pandas.util._decorators import Appender, Substitution, deprecate_kwarg |
| 18 | +from pandas.util._decorators import Appender, Substitution |
19 | 19 |
|
20 | 20 | from pandas.core.dtypes.common import (
|
21 | 21 | is_bool_dtype, is_categorical_dtype, is_datetime64_any_dtype,
|
@@ -1078,39 +1078,6 @@ def _addsub_offset_array(self, other, op):
|
1078 | 1078 | return type(self)(res_values, freq='infer')
|
1079 | 1079 | return self._from_sequence(res_values)
|
1080 | 1080 |
|
1081 |
| - @deprecate_kwarg(old_arg_name='n', new_arg_name='periods') |
1082 |
| - def shift(self, periods, freq=None): |
1083 |
| - """ |
1084 |
| - Shift index by desired number of time frequency increments. |
1085 |
| -
|
1086 |
| - This method is for shifting the values of datetime-like indexes |
1087 |
| - by a specified time increment a given number of times. |
1088 |
| -
|
1089 |
| - Parameters |
1090 |
| - ---------- |
1091 |
| - periods : int |
1092 |
| - Number of periods (or increments) to shift by, |
1093 |
| - can be positive or negative. |
1094 |
| -
|
1095 |
| - .. versionchanged:: 0.24.0 |
1096 |
| -
|
1097 |
| - freq : pandas.DateOffset, pandas.Timedelta or string, optional |
1098 |
| - Frequency increment to shift by. |
1099 |
| - If None, the index is shifted by its own `freq` attribute. |
1100 |
| - Offset aliases are valid strings, e.g., 'D', 'W', 'M' etc. |
1101 |
| -
|
1102 |
| - Returns |
1103 |
| - ------- |
1104 |
| - pandas.DatetimeIndex |
1105 |
| - Shifted index. |
1106 |
| -
|
1107 |
| - See Also |
1108 |
| - -------- |
1109 |
| - Index.shift : Shift values of Index. |
1110 |
| - PeriodIndex.shift : Shift values of PeriodIndex. |
1111 |
| - """ |
1112 |
| - return self._time_shift(periods=periods, freq=freq) |
1113 |
| - |
1114 | 1081 | def _time_shift(self, periods, freq=None):
|
1115 | 1082 | """
|
1116 | 1083 | Shift each value by `periods`.
|
|
0 commit comments