# Kendall tau-b with one set containing only ties

I try to calculate the Kendall tau-b rank correlation for a huge number of paired sets. Some of those sets contain only ties, e.g.,

x1 = [1,1,1,1,1,1]


which is compared to another set

x2 = [1,1,1,1,2,2]


Python's Kendall tau-b module

import scipy.stats as stats
stats.kendalltau(x1, x2)


results in

KendalltauResult(correlation=nan, pvalue=nan)


I guess this is because one of the factors in the denominator is zero. Is there any solution to get an approximate tau-b coefficient for such situations. Does anybody know what the limit would be? Or which value one usually would assign in such situations?

• Try tau-c maybe. – Carl May 12 '18 at 4:47