Tschuprow’s T - mauriceling/mauriceling.github.io GitHub Wiki

Purpose: Measures the degree of association between 2 categorical variables (defining the rows and columns).

Code:

>>> from scipy import stats
>>> table = [[77, 90, 404, 200],
             [16, 50, 122, 205],
             [20, 43, 150, 320]]
>>> result = stats.contingency.association(table, method="tschuprow")
>>> print("T = %.3f" % result)
T = 0.209