for k in range(100):
    m[k] += empirical[o, k]
o = choices[0]
for k in range(100):
    n[k] = expected[o, k]
for j in range(1, length):
    o = choices[j]
for k in range(100):
    n[k] += expected[o, k]
for k in range(100):
    ret[i, k] = m[k] / n[k] - 1.0
ret.sort(axis=0)
return ret[int(trial * 0.025)].reshape((10, 10)), ret[int(trial * 0.975)
    ].reshape((10, 10))
Опять нет прироста скорости от Cython?