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

Matthew Brett matthew.brett at gmail.com
Thu Jan 3 18:04:52 EST 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