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

Matthew Brett matthew.brett@gmail....
Thu Jan 3 17:04:52 CST 2008


> > So, currently we have all and allclose giving the same answer:
> >
> > In [19]: a = array([])
> >
> > In [20]: b = array([1])
> >
> > In [21]: all(a == b)
> > Out[21]: True
> >
> > In [22]: allclose(a, b)
> > Out[22]: True
> >
> > Would we want the answers to be different?
>
> No. I wasn't thinking correctly, previously.

It's unfortunate that all of us immediately think the given answer is wrong.


More information about the Numpy-discussion mailing list