I have numpy array like:
A = np.zeros((X,Y,Z))
Later I fill the array with values and I need to find x,y coordinates according to values in arrays on z axis to replace it with different array.
Example withZ=2 I have array
A = [ [ [1,2], [2,1], [0, 0] ],
[ [1,1], [1,1], [0, 0] ], ]
I need something like
A[ where A[x,y,:] == [1,2] ] = [2,1]
What will produce array
A = [ [ [2,1], [2,1], [0, 0] ],
[ [1,1], [1,1], [0, 0] ], ]
Is it possible to achieve that somehow simple? I would like to avoid iteration over the x,y coordinates.