[Numpy-discussion] [SciPy-dev] SciPy Sprint results

Stefan van der Walt stefan@sun.ac...
Fri Dec 21 02:43:28 CST 2007


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


More information about the Numpy-discussion mailing list