Skip to content
Advertisement

Tag: sliding-window

Sliding window of M-by-N shape numpy.ndarray

I have a Numpy array of shape (6,2): I need a sliding window with step size 1 and window size 3 like this: I’m looking for a Numpy solution. If your solution could parametrise the shape of the original array as well as the window size and step size, that’d be great. I found this related answer Using strides for

Advertisement