[SciPy-User] numpy.where() issue

Gabriele Brambilla gb.gabrielebrambilla at gmail.com
Wed Jul 15 14:13:20 EDT 2015


I have problems with numpy.where

why if I write
deathnote0 = np.where(Yy > 0.02 or Yy < -0.02)
I get:

Traceback (most recent call last):

  File "readingK.py", line 63, in <module>

    deathnote0 = np.where(Yy > 0.02 or Yy < -0.02)

ValueError: The truth value of an array with more than one element is
ambiguous. Use a.any() or a.all()

while if I do

deathnote0 = np.where(Yy > 0.02)

deathnote1 = np.where(Yy < -0.02)

deathnote = deathnote0 + deathnote1

it works?


thanks


Gabriele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20150715/6a8d1da7/attachment.html>


More information about the SciPy-User mailing list