`vals[~cond] = 0` may be better