The numpy `where` function is different than the IDL `where` function. You don't need `where` here. It is sufficient to do `valid = (x >= 0.3) & (x < 1.1)`.