[SciPy-User] [SciPy-user] ValueError: The truth value of an array with more than one element is ambiguous.

Kevin Gullikson kevin.gullikson@gmail....
Thu Apr 5 18:10:01 CDT 2012


My only thought is that Xa, Ya, and/or Za are arrays? That array will show
up if you have say:
a = [False, True]
if a:
 ...

Kevin Gullikson



On Thu, Apr 5, 2012 at 5:46 PM, surfcast23 <surfcast23@gmail.com> wrote:

> Hi, I have an if statement and what I want it to do is go through arrays
> and find the common elements in all three arrays. When I try the code below
> I get this error * ValueError: The truth value of an array with more than
> one element is ambiguous. Use a.any() or a.all()* Can some one explain
> the error to me and how I might be able to fix it. Thanks in advance. *if
> min <= Xa <=max & min <= Ya <=max & min <= Za <=max: print("in range")
> else: print("Not in range") *
> ------------------------------
> View this message in context: ValueError: The truth value of an array
> with more than one element is ambiguous.<http://old.nabble.com/ValueError%3A-The-truth-value-of-an-array-with-more-than-one-element-is-ambiguous.-tp33583156p33583156.html>
> Sent from the Scipy-User mailing list archive<http://old.nabble.com/Scipy-User-f33045.html>at Nabble.com.
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120405/c6b89c7e/attachment-0001.html 


More information about the SciPy-User mailing list