Say I have a numpy array:
>>> a
array([0,1,2,3,4])
and I want to "rotate" it to get:
>>> b
array([4,0,1,2,3])
What is the best way?
I have been converting to a deque and back (see below) but is there a better way?
b = deque(a)
b.rotate(1)
b = np.array(b)