I have an array with shape (100000,)
over which I want to apply a sliding window of length 200 with a step size of 1. This means that the output array will have the shape (99800,200)
- i.e., all unique chunks of length 200. I cannot find an efficient function in numpy that achieves this. I have tried:
for i in range(data.shape[0] - 200):
windows = np.append(windows , data[i:i+200]);
Which not only produces the wrong shape (1D), but it is also incredibly slow. Is there a fast function in Numpy to do this?