I have two 2d numpy arrays:
X2d = np.array([[0,4,5,0],
[7,8,4,3],
[0,0,9,8]])
Y2d = np.array([[1,0,4,8],
[0,3,8,5],
[0,6,0,8]])
#and I would like to get these two:
X2dresult = np.array([[0,0,5,0],
[0,8,4,3],
[0,0,0,8]])
Y2dresult = np.array([[0,0,4,0],
[0,3,8,5],
[0,0,0,8]])
So basically I need to keep those positions where both of the matrices are greater than 0. Can I use numpy.where function or something like that to get these results? Thanks