[NumPy-Tickets] [NumPy] #2043: Can't index with a zero length bool array

NumPy Trac numpy-tickets@scipy....
Thu Feb 9 12:27:20 CST 2012


#2043: Can't index with a zero length bool array
------------------------+---------------------------------------------------
 Reporter:  radford     |       Owner:  somebody   
     Type:  defect      |      Status:  new        
 Priority:  normal      |   Milestone:  Unscheduled
Component:  numpy.core  |     Version:  devel      
 Keywords:              |  
------------------------+---------------------------------------------------
 You can index an array with a boolean array for all lengths except zero.
 Specifically this works for i>0, but not when it's i==0.

     i = 0; np.arange(3*i).reshape(3,i)[:,np.bool_([True] * i)]

 Attached is a proposed patch to fix the problem.

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


More information about the NumPy-Tickets mailing list