I'm coding in python and I would like to know how I can get the indexes of a matrix A where the matrix B is contained in A. For example, if we have
A = [[1,2,3],
[4,5,6],
[7,8,9]]
and
B = [[2,3],
[5,6]]
Then it returns indexes ([0,0,1,1], [1,2,1,2]), where the first list corresponds to x-axis, and the second to the y-axis. Or something like this.
Thank you for yor help !
You can check this question to find if a matrix is a submatrix of another one.
Then, you can get the coordinates of each element exploiting the NumPy
wherefunction as: