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

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


On Jan 3, 2008 1:06 PM, Robert Kern <robert.kern at gmail.com> wrote:

> Andrew Straw wrote:
> > Apologies if I've missed the discussion of this, but I was recently
> > surprised by the following behavior (in svn trunk 4673). The following
> > code runs without triggering the assertion.
> >
> > import numpy as np
> > print np.__version__
> > a=np.int32(42)
> > b=np.array([],dtype=np.int32)
> > assert np.allclose(a,b)
> >
> > Is this expected behavior of numpy or is this a bug I should report?
>
> Bug, I think.


Isn't it trivially true that all elements of an empty array are close to any
number? For instance, it is a well known fact that all blue, cheese eating
martians speak esperanto.

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


More information about the NumPy-Discussion mailing list