def _ordinal_metric(_v1, _v2, i1, i2, n_v):
if i1 > i2:<EOL><INDENT>i1, i2 = i2, i1<EOL><DEDENT>return (np.sum(n_v[i1:(i2 + <NUM_LIT:1>)]) - (n_v[i1] + n_v[i2]) / <NUM_LIT:2>) ** <NUM_LIT:2><EOL>
Metric for ordinal data.