[Numpy-discussion] initialise an array

Humufr humufr at yahoo.fr
Tue Jan 10 07:22:01 CST 2006


I have a function like this:

def test(x,xall=None):
     if xall == None: xall =x
I obtain this error message when I'm doing this with numpy (I don't have 
this problem with numarray and Numeric).

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

How can I do something similar? Do I have to use the function suggest in 
the error message? The function is something inside a long script with a 
lot of condition similar to this one so it's why I ask if it's normal to 
not have the special None parameter take in count.



More information about the Numpy-discussion mailing list