[Numpy-tickets] [NumPy] #239: creation of object arrays not as advertised

NumPy numpy-tickets at scipy.net
Thu Aug 10 08:51:53 CDT 2006


#239: creation of object arrays not as advertised
------------------------+---------------------------------------------------
 Reporter:  stefan      |       Owner:  oliphant     
     Type:  defect      |      Status:  new          
 Priority:  normal      |   Milestone:  1.0 Release  
Component:  numpy.core  |     Version:  devel        
 Severity:  normal      |    Keywords:  object arrays
------------------------+---------------------------------------------------
 From the mailing list post at

 http://thread.gmane.org/gmane.comp.python.numeric.general/6992/focus=6992

 one expects the following behaviour:

 {{{
 array([[1,2],3,4],dtype=object)  returns a 1-d array of shape (3,)

 array([[1,2],[3,4]],dtype=object)  returns a 2-d array of shape (2,2)

 array([(1,2),(3,4)],dtype=object) returns a 1-d array of shape (2,)

 array([],dtype=object) returns a 0-d array of shape ()

 array([[],[],[]],dtype=object) returns a 1-d array of shape (3,)

 array([[3,4],[5,6],None],dtype=object) returns a 1-d array of shape (3,)
 }}}

 but some of these return incorrect results, for example

 {{{
 array([[1,2],3,4],dtype=object)
 }}}

 yields a (3,2) array.

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/239>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list