Im trying to solve a problem in which I am given 2 ndarray of booleans . one of shape (n,m,z), denote as A, and the other (n,m), denote as B. If I am thinking of the 3D array as an array of 'z' 2D arrays, I would like to check if for every i between 0 and z, there is at least one coordinate [x,y] that: A[x,y,i] == B[x,y] == 1.
for example: let A be
np.array([[[1,0,0],
[0,1,0],
[0,0,1]]
,
[[0,1,0],
[0,1,0],
[0,1,0]],
[[1,0,0],
[0,1,0],
[0,0,1]]])
and B be:
> [[1,0,0],
[0,1,0],
[0,0,1]])
The function should return True!
I need to solve it without any loops (just numpy tools)!
Thank you in advance.