[Scipy-tickets] [SciPy] #1658: scipy.stats.kendalltau returns 1 instead of (1, p) "for all ties in both ranks"

SciPy Trac scipy-tickets@scipy....
Thu May 10 15:08:51 CDT 2012


#1658: scipy.stats.kendalltau returns 1 instead of (1, p) "for all ties in both
ranks"
--------------------------+-------------------------------------------------
 Reporter:  ffinkernagel  |       Owner:  somebody   
     Type:  defect        |      Status:  new        
 Priority:  normal        |   Milestone:  Unscheduled
Component:  Other         |     Version:  0.10.0     
 Keywords:                |  
--------------------------+-------------------------------------------------
 >>> scipy.stats.kendalltau([0, 1, 0], [0, 0, 1])
 (-0.5, 0.43342194319179717)
 >>> scipy.stats.kendalltau([0, 0, 0], [0, 0, 0])
 1

 Documentation states it returns (tau, p), returning a single int
 is unexpected.

 I'm not sure what p-value to return though.

 The bug is around line 2750 of stats.py
 if tot == u and tot == v:
         return 1    # Special case for all ties in both ranks

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


More information about the Scipy-tickets mailing list