[NumPy-Tickets] [NumPy] #2063: unique() does not seem to return correct index if array larger than 16

NumPy Trac numpy-tickets@scipy....
Thu Feb 23 02:44:07 CST 2012


#2063: unique() does not seem to return correct index if array larger than 16
------------------------+---------------------------------------------------
 Reporter:  lolowizard  |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  highest     |   Milestone:  1.6.2   
Component:  numpy.core  |     Version:  1.6.1   
 Keywords:  unique      |  
------------------------+---------------------------------------------------
 Unique seem to return the index of the last occurence rather than first
 occurence if len(array)>16

 To reproduce:
 v=[0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2]
 w=[0,0,0,0,0,1,1,1,1,1,1,2,2,2,2]

 Only difference between v and w is the two extra values at the end.

 Then:
 unique(v,return_index=True)
 unique(w,return_index=True)

 Look at the results for both commands:

 (array([0, 1, 2]), array([ 0, 10, 15]))

 (array([0, 1, 2]), array([0, 5, 9]))

 The two commands should return the same index!

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


More information about the NumPy-Tickets mailing list