[NumPy-Tickets] [NumPy] #2074: random.shuffle fails if row in multidimensional array is None

NumPy Trac numpy-tickets@scipy....
Mon Mar 5 07:24:15 CST 2012


#2074: random.shuffle fails if row in multidimensional array is None
---------------------------+------------------------------------------------
 Reporter:  tillahoffmann  |       Owner:  somebody   
     Type:  defect         |      Status:  new        
 Priority:  normal         |   Milestone:  Unscheduled
Component:  numpy.random   |     Version:  1.6.1      
 Keywords:  shuffle; None  |  
---------------------------+------------------------------------------------
 The random.shuffle fails if an array is multidimensional and one of the
 rows is None:
 {{{
 from numpy.random import shuffle
 a = [1,2,3,None]
 shuffle(a) #Works fine
 b = [(1,1),(2,2),(3,3),None]
 shuffle(b) #Fails
 }}}

 with the following error message

 {{{
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "mtrand.pyx", line 4283, in mtrand.RandomState.shuffle
 (numpy/random/mtrand/mtrand.c:18131)
 TypeError: 'NoneType' object is unsliceable
 }}}

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


More information about the NumPy-Tickets mailing list