say I have the following array j:
[[1, 2, 3, 4, 5],
[7, 7, 7, 6, 4],
[1, 1, 2, 0, 0]]
how can I get the subarray of 2x2 so the subarray would be:
[[1, 2],
[7, 7],]
intuitively I assumed j[0:2][0:2] would do the trick but I get:
[[1, 2, 3, 4, 5], [7, 7, 7, 6, 4]]
j[:2, :2]array,subarrayandmatrixsuggest you are usingnumpy. But the examples are indistinguishable from a list of lists.