On Fri, May 23, 2008 at 12:22 PM, Keith Goodman <[EMAIL PROTECTED]> wrote:

> But the first example
>
>>> x = mp.matrix([[mp.nan]])
>>> x
>   matrix([[ NaN]])
>>> x.all()
>   True
>>> x.any()
>   True
>
> is still surprising.

On non-boolean arrays, .all() and .any() check each element to see if
it is not equal to 0. NaN != 0. Returning False would be just as
wrong. If there were a Maybe in addition to True and False, then
perhaps that would be worth changing, but I don't see a reason to
change the rule as it is.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to