[Numpy-tickets] [NumPy] #478: numpy.rec.array is inconsistent on objects

NumPy numpy-tickets@scipy....
Mon Mar 26 12:09:25 CDT 2007


#478: numpy.rec.array is inconsistent on objects
--------------------+-------------------------------------------------------
 Reporter:  faltet  |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  normal  |   Milestone:          
Component:  Other   |     Version:          
 Severity:  normal  |    Keywords:          
--------------------+-------------------------------------------------------
 Hi,

 I find this to be incosistent:

 {{{
 In [134]:1. == numpy.array(1.)
 Out[134]:True
 # However...
 In [135]:numpy.rec.array([[1.]], dtype=[('var1', 'f8')])
 Out[135]:
 recarray([(1.0,)],
       dtype=[('var1', '<f8')])
 In [136]:numpy.rec.array([[numpy.array(1.)]], dtype=[('var1', 'f8')])
 Out[136]:
 recarray([[(1.0,)]],
       dtype=[('var1', '<f8')])
 }}}

 out[135] has a different level of nesting than out[136], but they should
 be equal.

 In the same way:

 {{{
 In [138]:numpy.rec.array([[1.]], dtype=[('var1', 'f8', (2,))])
 Out[138]:
 recarray([(array([ 1.,  1.]),)],
       dtype=[('var1', '<f8', (2,))])
 In [139]:numpy.rec.array([numpy.array([1.])], dtype=[('var1', 'f8',
 (2,))])
 Out[139]:
 recarray(([1.0, 1.0],),
       dtype=[('var1', '<f8', (2,))])
 }}}

 Why the difference?

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


More information about the Numpy-tickets mailing list