Array:
arr = np.ones([4,4])
array([[ 1., 1., 1., 1.],
[ 1., 1., 1., 1.],
[ 1., 1., 1., 1.],
[ 1., 1., 1., 1.]])
I use shift from scipy.ndimage.interpolation as follows:
shift(arr,1, cval=np.nan)
array([[ nan, nan, nan, nan],
[ nan, 1., 1., 1.],
[ nan, 1., 1., 1.],
[ nan, 1., 1., 1.]])
HOWEVER, I want:
array([[ nan, nan, nan, nan],
[ 1., 1., 1., 1.],
[ 1., 1., 1., 1.],
[ 1., 1., 1., 1.]])
Basically, I want to SHIFT all columns data down the rows and boot the last row out of my data set. Pandas has the shift function that can do this but I'm not certain how it can be done in Numpy.