Say I have the following list of lists:
x = [[1,2,3],[4,5,6],[7,8,9,10]]
And I wish to select all 'windows' of size e.g. n=4
, staggered by a distance of e.g. d=2
:
[[1,2,3],[4]] # Starts at position `0`
[[3],[4,5,6]] # Starts at position `d`
[[5,6],[7,8]] # Starts at position `2d`
[[7,8,9,10]] # Starts at position `3d`
I.e. I wish to take intersecting 'slices' where the windows overlap with the sublists.
How would I go about this?