I need to slice 12*12 matrix to 24 2*3 pieces. Matrix of input is:
arr = [
[1,0,1,1,1,0,1,1,1,0,1,0],
[0,0,0,1,0,1,1,1,1,0,1,0],
[0,1,1,0,0,0,1,0,1,0,0,0],
[1,0,0,1,0,0,1,1,1,0,1,1],
[0,0,0,1,0,0,0,1,1,1,1,0],
[0,0,0,0,0,1,1,0,0,0,0,1],
[1,0,1,0,0,0,1,1,0,0,1,1],
[0,0,1,1,0,1,0,1,1,0,1,0],
[0,1,0,0,0,0,1,0,1,0,0,1],
[1,1,0,1,0,1,0,1,0,1,0,0],
[0,0,1,1,1,1,0,1,0,1,1,1],
[0,0,0,0,1,0,0,0,1,1,0,0]]
I try to achieve the task with numpy Matrix:
from sympy import Matrix
Matrix(arr)[:3,:2]
But it will give only one slice from the original matrices.
Matrix([
[1, 0],
[0, 0],
[0, 1]])
What is the convenient way to slice 12*12 matrices to 2*3 pieces? I also need to have dimensions 3*2 of the original, but suppose it's easy after getting the first one ready.