Say I have an array like so:
array([1, 2, 3, 4, 5, 5, 7, 8, 9, 10])
I want to change it to
array([1, 2, 3, 4]), array([3, 4, 5, 6]), array([5, 6, 7, 8]), array([7, 8, 9, 10])
Here the window size would be 4
, and step size would be 2
.
How can I do this in a Python function?