Shift elements in a numpy array
This question contains its own answer at the bottom. Use preallocated arrays. Following-up from this question years ago, is there a canonical "shift" function in numpy? I don't see anything