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

Andrew Straw strawman at astraw.com
Thu Jan 3 18:35:17 EST 2008


Matthew Brett wrote:
>>> 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.
Maybe we need "allclose_sameshape()" (my ability to name stuff is
terrible, but you get the idea). Regardless of the name issue, I have no
idea how this is viewed against the no-namespace-bloat principle.



More information about the NumPy-Discussion mailing list