[Numpy-discussion] Arrays of poly1d objects, is this a bug?

Travis Oliphant oliphant at ee.byu.edu
Fri Jan 26 15:50:14 EST 2007

Fernando Perez wrote:

>Hi all,
>I'm puzzled by this behavior a colleague ran into:
>In [38]: p1=N.poly1d([1.])
>In [39]: a=N.array([p1],dtype='O')
>In [40]: a
>Out[40]: array([], shape=(1, 0), dtype=object)
>In [42]: print a

Stefan correctly identified the problem.   The dimension-discovery code 
is getting confused.
This might actually be a fixable bug.  But, in general getting the 
N.array() code to correctly guess where the "Object-line" should be 
drawn is difficult at best.   The current code is a re-write of a 
previous code.  But, still it cannot solve the poorly defined problem.

So, I would suggest creating empty arrays and populating them...


More information about the NumPy-Discussion mailing list