Can someone explain to me how to accomplish this?
[
[1, 2, 9, 10, 17, 18],
[3, 4, 11, 12, 19, 20],
[5, 6, 13, 14, 21, 22],
[7, 8, 15, 16, 23, 24]
]
=>
[
[
[1, 2],
[3, 4]
],
[
[2, 9],
[4, 11]
],
[
[9, 10],
[11, 12]
],
[
[10, 17],
[12, 19]
],
[
[17, 18],
[19, 20]
]
],
[
[
[5, 6],
[7, 8]
],
[
[6, 13],
[8, 15]
]
...
]
I tried to use numpy.split but this allows only for non-overlapping subarrays.
Basically these are all subarrays of size (2,2) where an imaginary window is moved from top left to bottom right by one column each time.