Instead of np.invert, use "~"?