With some numpy array a, what I'd like to do is
indices = np.where((a < 4) or (a > 12))
This isn't valid. It just returns "The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()". But this expression isn't ambiguous, and any
and all
don't do what I want to do. (any
and all
can't take compound expressions either. But if
can. Confused...)