[NumPy-Tickets] [NumPy] #1957: column mean is not invariant to row permutation

NumPy Trac numpy-tickets@scipy....
Thu Sep 29 12:52:29 CDT 2011


#1957: column mean is not invariant to row permutation
-------------------------------+--------------------------------------------
 Reporter:  john200p4          |       Owner:  somebody   
     Type:  defect             |      Status:  new        
 Priority:  normal             |   Milestone:  Unscheduled
Component:  Other              |     Version:  1.6.0      
 Keywords:  mean, permutation  |  
-------------------------------+--------------------------------------------
 Hello.
 I noticed this behavior and do not know if it is a bug.  Given a large
 matrix, the column means will be slightly different depending on the
 permutation of the rows.  For example:

 >>> a = random.rand(2300,20)
 >>> ii = random.permutation(2300)
 >>> b = a[ii].copy()

 >>> abs(a.mean(0) - b.mean(0)).max()
 1.3322676295501878e-15

 >>> abs(a.mean(0) - b[argsort(ii)].mean(0)).max()
 0.0

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


More information about the NumPy-Tickets mailing list