Can anybody explain me the numpy.indices()?
Suppose you have a matrix M whose (i,j)-th element equals M_ij = 2*i + 3*j One way to define this matrix would be i, j = np.indices((2,3)) M = 2*i + 3*j which yields array([[0, 3, 6], [2, 5, 8]]) In other words, np.indices returns arrays which can be used as indices. The elements in … Read more