[Scipy-tickets] [SciPy] #1634: scoreateprecentile return the worng value when used on pandas.Series

SciPy Trac scipy-tickets@scipy....
Sun Apr 8 11:38:58 CDT 2012


#1634: scoreateprecentile return the worng value when used on pandas.Series
----------------------------------------+-----------------------------------
 Reporter:  imrisofer                   |       Owner:  somebody      
     Type:  defect                      |      Status:  needs_decision
 Priority:  normal                      |   Milestone:  Unscheduled   
Component:  scipy.stats                 |     Version:  0.10.0        
 Keywords:  scoreateprecentile, pandas  |  
----------------------------------------+-----------------------------------
Changes (by rgommers):

  * status:  new => needs_decision


Comment:

 I think scoreatpercentile can use {{{np.asarray}}}. This shouldn't be a
 problem with np.matrix input, and masked arrays don't work correctly
 anyway:
 {{{
 In [15]: a = np.ma.MaskedArray(np.arange(5), mask=[0, 1, 0, 1, 0])

 In [16]: a
 Out[16]:
 masked_array(data = [0 -- 2 -- 4],
              mask = [False  True False  True False],
        fill_value = 999999)


 In [17]: sp.stats.scoreatpercentile(a, 50)
 Out[17]: 4

 In [18]: sp.stats.scoreatpercentile(a, 80)  #incorrect
 Out[18]: masked
 }}}

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


More information about the Scipy-tickets mailing list