I have arrays
A = np.array([
[1,6,5],
[2,3,4],
[8,3,0]
])
B = np.array([
[3,2,1],
[9,2,8],
[2,1,8]
])
Doing a = np.argwhere(A > 4) gives me an array of position/indexes of values in array A that are greater than 4 i.e. [[0 1], [0 2], [2 0]].
I need to use these indexes/position from a = np.argwhere(A > 4) to replace the values in array B to zero at these specific position i.e. array B should now be
B = np.array([
[3,0,0],
[9,2,8],
[0,1,8]
])
I am big time stuck any help with this will be really appreciated.
Thank You :)
B[A > 4] = 0?