[NumPy-Tickets] [NumPy] #2035: Broadcasting with masked array doesn't work with divide (after tile instruction)

NumPy Trac numpy-tickets@scipy....
Thu Feb 2 02:43:52 CST 2012


#2035: Broadcasting with masked array doesn't work with divide (after tile
instruction)
------------------------------+---------------------------------------------
 Reporter:  elephantterrible  |       Owner:  somebody
     Type:  defect            |      Status:  new     
 Priority:  normal            |   Milestone:  1.6.2   
Component:  Other             |     Version:  1.6.1   
 Keywords:                    |  
------------------------------+---------------------------------------------
 Broadcasting in a division does not work after a tile instruction.

 See attached script to reproduce.

 If the tile instruction is commented out, the division works.
 Division also works if numpy.divide() is used, or if there's no masked
 value.

 Python gives the following error:

 Traceback (most recent call last):
   File "ma_tiling_issue.py", line 18, in <module>
     a/100. #raises ValueError: invalid return array shape
   File "/usr/local/lib/python2.7/dist-packages/numpy/ma/core.py", line
 3654, in __div__
     return divide(self, other)
   File "/usr/local/lib/python2.7/dist-packages/numpy/ma/core.py", line
 1078, in __call__
     m |= ma
 ValueError: non-broadcastable output operand with shape (3,3,3) doesn't
 match the broadcast shape (1,3,3,3)

 The error occurs in all numpy versions (1.5.1, 1.6.1, 2.0.0.dev) with
 python 2.7.1

 The original bug discussion is on numpy-discuss:
 http://www.mail-archive.com/numpy-discussion@scipy.org/msg35146.html

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


More information about the NumPy-Tickets mailing list