1 Oct
2009
1 Oct
'09
4:55 p.m.
I've defined the following one-line function that uses numpy.where: def sin_half_period(x): return where(0.0 <= x <= pi, sin(x), 0.0) When I try to use this function, I get an error message: In [4]: z=linspace(0,2*pi,9) In [5]: sin_half_period(z) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) The truth value of an array with more than one element is ambiguous. Use a.any () or a.all() Any suggestions will be appreciated. -- View this message in context: http://www.nabble.com/difficulty-with-numpy.where-tp25702676p25702676.html Sent from the Numpy-discussion mailing list archive at Nabble.com.