[Scipy-tickets] [SciPy] #1653: scoreatprecentile return wrong values when used on array with NaNs

SciPy Trac scipy-tickets@scipy....
Wed May 2 19:53:25 CDT 2012


#1653: scoreatprecentile return wrong values when used on array with NaNs
-------------------------+--------------------------------------------------
 Reporter:  imrisofer    |       Owner:  somebody   
     Type:  defect       |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  scipy.stats  |     Version:  0.10.0     
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by imrisofer):

 It seems that stats.mstats.scoreatpercentile does not behave as
 stats.scoreatpercentile
 {{{
 from numpy import array, ma
 import scipy.stats as stats


 #create a simple array
 a = array([1,2,3,4.])
 print a

 #print percentiles of a using stats.scoreatpercentile
 print "stats.scoreatpercentile(a, q)"
 print "q50: ", stats.scoreatpercentile(a, 50)
 print "q90: ", stats.scoreatpercentile(a, 90)
 print

 #print percentiles of a using stats.mstats.scoreatpercentile
 print "stats.mstast.scoreatpercentile(a, q)"
 print "q50: ", stats.mstats.scoreatpercentile(a,50)
 print "q90: ", stats.mstats.scoreatpercentile(a,90)
 print
 }}}

 output:

 {{{
 [ 1.  2.  3.  4.]
 stats.scoreatpercentile(a, q)
 q50:  2.5
 q90:  3.7

 stats.mstast.scoreatpercentile(a, q)
 q50:  2.5
 q90:  4.0

 }}}

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


More information about the Scipy-tickets mailing list