I have the following numpy arrays
A: shape (n1, n2) array of float
B: shape (n2,) array of float
M: shape (n1, n2) array of bool
How do I turn the following pseduo-code inte efficient real code? The arrays may be huge, possibly > 100 million elements.
A[M] = ("B broadcast to shape (n1,n2)")[M]