Bob Dowling <rjd4+numpy <at> cam.ac.uk> writes: [clip] > I'm guessing that numpy.where() is evaluating the complete arccos and > arccosh arrays and therefore getting invalid arguments. > > Now, I can turn off the warnings with numpy.seterr(invalid='ignore') but > that's not what I would regard as good practice. > > Is there a "numpythonic" way to address the issue?
Correct, the arguments are evaluated first, due to how Python semantics work. You may want to use this: http://docs.scipy.org/doc/numpy/reference/generated/numpy.piecewise.html _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion