[NumPy-Tickets] [NumPy] #1640: structured array incorrectly gives a broadcast error

NumPy Trac numpy-tickets@scipy....
Fri Oct 15 18:05:37 CDT 2010


#1640: structured array incorrectly gives a broadcast error
-----------------------+----------------------------------------------------
 Reporter:  m-paradox  |       Owner:  somebody
     Type:  defect     |      Status:  new     
 Priority:  normal     |   Milestone:  2.0.0   
Component:  Other      |     Version:  devel   
 Keywords:             |  
-----------------------+----------------------------------------------------
 Here's a simple failure that should work:

 >>> p = np.rec.recarray((2,),dtype=[('f0','f4',3),('f1','f4',1)])
 >>> p==p
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 ValueError: shape mismatch: objects cannot be broadcast to a single shape

 A slightly different dtype, and it works:

 >>> p = np.rec.recarray((2,),dtype=[('f0','f4',2),('f1','f4',1)])
 >>> p==p
 rec.array([[ True,  True],
        [ True,  True]], dtype=bool)

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1640>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list