[Numpy-discussion] unexpected behavior with allclose( scalar, empty array)

Charles R Harris charlesr.harris at gmail.com
Thu Jan 3 17:25:57 EST 2008


On Jan 3, 2008 2:37 PM, Matthew Brett <matthew.brett at gmail.com> wrote:

> Just to ask - is there a reason why this:
>
> > In [39]: all([])
> > Out[39]: True
>
> is the case?


Because it's True. Anything is true about the elements of an empty set,
because there aren't any. In this case, all asks if all elements in [] are
true, i.e., does x member [] -> x is true. Since x member [] is always
false, the implication is always true. Recall that the statement x -> y has
the same truth value as the statement x' or xy.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080103/f8ed8cf9/attachment.html>


More information about the NumPy-Discussion mailing list