mask 3d matrix with 2d matrix python code example Example: apply 2d mask to 3d array python field3d_mask = np.broadcast_to(field2d > 0.3, field3d.shape)