Simple slices form views into the parent array. The strides of the view is generically the multiple of the strides of the parent array.
Given 2d parent array with strides
as_strided I can do what you want:
In : X=np.eye(5) In : X.strides Out: (40, 8) In : np.lib.stride_tricks.as_strided(X,shape=(5,),strides=(48,)) Out: array([ 1., 1., 1., 1., 1.])
though some would argue the
as_strided is a step closer to the 'guts' than most of
numpy Python code.