Not sure how to best title this question, but basically I would like to generate a new numpy array to be based on an existing array. The only difference is that the values have been shifted to an index I specify. Also assume that wrapping is required.
For simplicity, consider the base array:
[[0,1,2],
[3,4,5],
[6,7,8]]
If I want the zero (0) or the first element from the base array to be shifted at (0,1), it will be:
[[2,0,1],
[5,3,4],
[8,6,7]]
If I want the first element moved at (2,2) it will be:
[[4,5,3],
[7,8,6],
[1,2,0]]
np.rollis O(n).