[SciPy-dev] Arrays as truth values?

Ed Schofield schofield at ftw.at
Tue Nov 8 09:43:04 CST 2005



On Tue, 8 Nov 2005, Perry Greenfield wrote:

> What about:
>
>  >>> a1 = array([[1,2,3],[1,2,3]])
>  >>> a2 = array([1,2,3])
>  >>> a1 == a2
>
> These two arrays are not the same shape but because of broadcasting
> will show to be equal. Is this what you intended? Some might, some
> might not.

Ah, that's a good argument.  Okay, I'm sold ;)


-- Ed




More information about the Scipy-dev mailing list