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?
Here's a slight modification of @EdChum 's great answer, which I find more useful in situations where I want to avoid an assignment:
pandas.DataFrame(np.roll(df.values, 1), index=df.index)
or for Series:
pandas.Series(np.roll(ser.values, 1), index=ser.index)