It's nice I can do: f = np.linspace (0, 1, 100) u[f<.1] = 0 cool, this seems to work also: u[np.abs(f)<.1] = 0 cool! But exactly what kind of expressions are possible here? Certainly not arbitrary code.