def tiecorrect(xranks):
 rankbincount = np.bincount(np.asarray(xranks, dtype=int))
 nties = rankbincount[(rankbincount > 1)]
 ntot = float(len(xranks))
 tiecorrection = (1 - (((nties ** 3) - nties).sum() / ((ntot ** 3) - ntot)))
 return tiecorrection

def tiecorrect ( xranks ) : rankbincount = np . bincount ( np . asarray ( xranks , dtype = int ) ) nties = rankbincount [ ( rankbincount > 1 ) ] ntot = float ( len ( xranks ) ) tiecorrection = ( 1 - ( ( ( nties ** 3 ) - nties ) . sum ( ) / ( ( ntot ** 3 ) - ntot ) ) ) return tiecorrection
tie correction factor for ties in the mann-whitney u and kruskal-wallis h tests .