[Numpy-discussion] possible bug with numpy.object_

Fernando Perez fperez.net at gmail.com
Wed Aug 30 10:11:43 CDT 2006


On 8/30/06, Stefan van der Walt <stefan at sun.ac.za> wrote:

> The current behaviour makes sense, but is maybe not consistent:
>
> N.array([],dtype=object).size == 1
> N.array([[],[]],dtype=object).size == 2

Yes, including one more term in this check:

In [5]: N.array([],dtype=object).size
Out[5]: 1

In [6]: N.array([[]],dtype=object).size
Out[6]: 1

In [7]: N.array([[],[]],dtype=object).size
Out[7]: 2

Intuitively, I'd have expected the answers to be 0,1,2, instead of 1,1,2.

Cheers,

f




More information about the Numpy-discussion mailing list