[Numpy-tickets] [NumPy] #925: choose does not broadcast index array appropriately

NumPy numpy-tickets@scipy....
Fri Oct 3 09:50:58 CDT 2008

#925: choose does not broadcast index array appropriately
 Reporter:  oliphant  |       Owner:  somebody
     Type:  defect    |      Status:  new     
 Priority:  normal    |   Milestone:  1.3.0   
Component:  Other     |     Version:  none    
 Severity:  normal    |    Keywords:          
 The advertised behavior of choose(choices, sequence_of_arrays) is that the
 choices array and all the arrays in the sequence must be broadcastable to
 the same shape which is the shape of the output.

 However, NumPy does not look at the shape of the choices array, only the

 This requires an adaptation of the code in PyArray_Choose function in C.
 Probably the easiest thing is to construct a MultiIterator object to
 handle the broadcasting internal to that function, construct the output,
 and then fill appropriately.

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

More information about the Numpy-tickets mailing list