[Numpy-tickets] [NumPy] #721: 0-dimensional boolean arrays should work as masks for array scalars

NumPy numpy-tickets@scipy....
Tue Apr 8 17:53:30 CDT 2008


#721: 0-dimensional boolean arrays should work as masks for array scalars
--------------------+-------------------------------------------------------
 Reporter:  stefan  |        Owner:  oliphant
     Type:  defect  |       Status:  new     
 Priority:  normal  |    Milestone:  1.0.5   
Component:  Other   |      Version:  none    
 Severity:  normal  |   Resolution:          
 Keywords:          |  
--------------------+-------------------------------------------------------
Comment (by stefan):

 I would expect

 {{{
 x = np.array(0)
 m = np.array(True)
 x[m] == np.array(0)
 }}}

 Your specific example would be equivalent to 0[1], and that would give an
 out of bound error.

 This kind of functionality (not the specific case, necessarily) was
 proposed by Travis to make indexing more consistent over the different
 kind of arrays and scalars.

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


More information about the Numpy-tickets mailing list