The definition formula for $c$-index? I'm sorry if this question sounds trivial or is a duplicate, but I could't find a definition formula for the $c$-index. There are numerous questions and answers about it, but all I have skimmed assume that the reader knows how to compute it or has the software for that purpose.
I've read that for binary outcome it is equivalent to the area under the ROC curve. But I have an ordinal model, with more than two levels.
So, can someone please post, in a simple and concise answer, the formula defining the $c$-index, as used in ordinal regression with uncensored data?
P.S. I would also appreciate if someone could point me to a Python library which can compute the index and which works well with statsmodels.

As already noted above, $c$-index is related to Somers' $D$:
$$
c = \frac{D_{XY} + 1}{2}
$$
but that requires us to be able to compute $D_{XY}$. This is not quite trivial. In a comment below the linked answer, Frank Harrell explains how it's done in R's rms library:

Internal, all possible combinations of observations having different $Y$ values are examined, and the fraction of such pairs for which predictions are in the same order is the estimate of the concordance probability.

In the Python's scipy.stats module there is a function somersd to compute $D_{XY}$. One should pay attention, however, that $D$ is not symmetric: in general, $D_{XY} \neq D_{YX}$, so the order of the parameters is important. From the documentation:

somersd(x, y) calculates Somers' $D(Y|X)$

