I’m trying to collect groups of rows into sliding windows represented as vectors. Given the example input: An expected output would be: My latest attempt produces tumbling windows without padding. Here’s my code: I tried looking for variations of this, maybe by performing a SQL query like in this case or with some built-in SQL function such as ROWS N

# 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