I am using the shift method for a data series in pandas (documentation).
Is it possible do a cyclic shift, i.e. the first value become the last value, in one step?
To do this without using a single step:
>>> output = input.shift() >>> output.loc[output.index.min()] = input.loc[input.index.max()] >>> output Out[32]: 5 0.981553 15 0.995232 25 0.999794 35 1.006853 45 0.997781 Name: vRatio, dtype: float64