[Scipy-tickets] [SciPy] #1805: rankdata returns wrong results on masked arrays

SciPy Trac scipy-tickets@scipy....
Mon Jan 7 17:30:30 CST 2013


#1805: rankdata returns wrong results on masked arrays
-------------------------+--------------------------------------------------
 Reporter:  hberger      |       Owner:  rgommers   
     Type:  defect       |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  scipy.stats  |     Version:  0.11.0     
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by hberger):

 Thanks for looking into this. I'm more and more convinced that both sort
 and argsort for masked arrays are seriously broken. There is just no way
 to define a fill value within the range of valid floating point numbers
 and at the same time avoid cases where the sorting fails (see also my
 comment in the related numpy issue). On the other hand, sort and argsort
 handle NaN values fine in non-masked arrays. The easiest workaround within
 rankdata would therefore probably be to replace masked fields by NaN ina
 non-masked array and then use array.argsort.

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1805#comment:3>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list