Hi Travis

On Thu, Dec 20, 2007 at 05:24:44PM -0600, Travis E. Oliphant wrote:
> > * bool(x) raises a ValueError, as it does for ndarrays.
> >   
> What does bool(x) raise for numpy.core.ma.

It now behaves the same way as numpy does, raising a ValueError:

In [1]: bool(N.ma.array([0,1]))
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/stefan/work/scipy/<ipython console> in <module>()

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

In [2]: bool(N.array([0,1]))
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/stefan/work/scipy/<ipython console> in <module>()

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

Regards
Stéfan
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to