Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

lib.stride_tricks.sliding_window_view(x, window_shape, axis=None, *, subok=False, writeable=False)

x = np.arange(6)
>>> x.shape
(6,)
>>> v = sliding_window_view(x, 3)
>>> v.shape
(4, 3)
>>> v
array([[0, 1, 2],
       [1, 2, 3],
       [2, 3, 4],
       [3, 4, 5]])
Source by numpy.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
1+4 =