@@ -2256,18 +2256,19 @@ def sortlevel(self, level=None, ascending=True, sort_remaining=None):
2256
2256
return self .sort_values (return_indexer = True , ascending = ascending )
2257
2257
2258
2258
def shift (self , periods = 1 , freq = None ):
2259
- """Shift index by desired number of time frequency increments.
2259
+ """
2260
+ Shift index by desired number of time frequency increments.
2260
2261
2261
2262
This method is for shifting the values of datetime-like indexes
2262
2263
by a specified time increment a given number of times.
2263
2264
2264
2265
Parameters
2265
2266
----------
2266
- periods : int
2267
+ periods : int, default 1
2267
2268
Number of periods (or increments) to shift by,
2268
- can be positive or negative (default is 1) .
2269
- freq : pandas.DateOffset, pandas.Timedelta or string
2270
- Frequency increment to shift by (default is None) .
2269
+ can be positive or negative.
2270
+ freq : pandas.DateOffset, pandas.Timedelta or string, optional
2271
+ Frequency increment to shift by.
2271
2272
If None, the index is shifted by its own `freq` attribute.
2272
2273
Offset aliases are valid strings, e.g., 'D', 'W', 'M' etc.
2273
2274
@@ -2276,6 +2277,10 @@ def shift(self, periods=1, freq=None):
2276
2277
pandas.Index
2277
2278
shifted index
2278
2279
2280
+ See Also
2281
+ --------
2282
+ Series.shift : Shift values of Series.
2283
+
2279
2284
Examples
2280
2285
--------
2281
2286
Put the first 5 month starts of 2011 into an index.
0 commit comments