numpy mask without losing shape code example Example: numpy mask without losing shape np.where(arr>3, arr, 0)