I need to slice a 2D input array from row/col indices and a slicing distance. In my example below, I can extract a 3x3 submatrix from an input matrix, but I cannot adapt this co
Numpy has matrix slicing, so you can slice on both rows and columns.
mat_A[4:7, 4:7]
returns
[[44, 45, 46], [54, 55, 56], [64, 65, 66]]