Hi Peter, Thanks!!
Yes, when handled as a numpy array, it's working fine! Traceback (most recent call last): File "ZA.py", line 59, in <module> if temp_za == j: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() This error occurs when the temp_za ( a numpy array, print temp_za works fine) is compared with j. I am attaching the code. Another question how do I get an integer value for p_za / 2 . Type casting with int says: TypeError: only length-1 arrays can be converted to Python scalars. On 27 March 2013 23:37, Alan Gauld <alan.ga...@btinternet.com> wrote: > 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/ > > > ______________________________**_________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/**mailman/listinfo/tutor<http://mail.python.org/mailman/listinfo/tutor> > -- -------------------------------------------------------------------------- *Sayan Chatterjee* Dept. of Physics and Meteorology IIT Kharagpur Lal Bahadur Shastry Hall of Residence Room AB 205 Mob: +91 9874513565 blog: www.blissprofound.blogspot.com Volunteer , Padakshep www.padakshep.org
ZA.py
Description: Binary data
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor