Let's say I have a np.array
such as:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Given a window of size 5, I want to and get:
0, 1, 2, 3, 4
1, 2, 3, 4, 5
2, 3, 4, 5, 6
3, 4, 5, 6, 7
4, 5, 6, 7, 8
5, 6, 7, 8, 9
6, 7, 8, 9, 10
It's an easy problem any rookie can solve, just wanted to know what is the most Pythonic numpy implementation.