[Tutor] IndexError: index out of bounds

Alan Gauld alan.gauld at btinternet.com
Wed Mar 27 19:07:18 CET 2013


On 27/03/13 17:36, Sayan Chatterjee wrote:

> 2) Traceback (most recent call last):
>    File "ZA.py", line 43, in <module>
>      if p_za[i] > 4.0:
> ValueError: The truth value of an array with more than one element is
> ambiguous. Use a.any() or a.all()

This implies that p_za[i] is actually an array.
So maybe p_za is a list (of arrays)?
Try printing it to see.



-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list