I\'m trying to mask a 3D array (RGB image) with numpy.
However, my current approach is reshaping the masked array (output below). I have tried to follow the approach
After finding the following post on loss of dimensions HERE, I have found a solution using numpy.where:
masked_array = np.where(mask==1, a , 0)
This appears to work well.