Вы можете использовать этот подход,
Коэффициент корреляции Пирсона, вероятно, является наиболее широко используемой мерой для линейных отношений между двумя нормально распределенными переменными, как показано ниже,
![r = \frac{{}\sum_{i=1}^{n} (x_i - \overline{x})(y_i - \overline{y})} {\sqrt{\sum_{i=1}^{n} (x_i - \overline{x})^2(y_i - \overline{y})^2}} image](https://latex.codecogs.com/gif.latex?r&space;=&space;%5Cfrac%7B%7B%7D%5Csum_%7Bi=1%7D%5E%7Bn%7D&space;(x_i&space;-&space;%5Coverline%7Bx%7D)(y_i&space;-&space;%5Coverline%7By%7D)%7D&space;%7B%5Csqrt%7B%5Csum_%7Bi=1%7D%5E%7Bn%7D&space;(x_i&space;-&space;%5Coverline%7Bx%7D)%5E2(y_i&space;-&space;%5Coverline%7By%7D)%5E2%7D%7D)
where x and y are the two vectors and
are the meansof those vectors, value of r is always in between 0 and 1. Hence you may multipley 100 to get percentage value.
Here is the python implementation: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html
>>> from scipy import stats
>>> x = [18000,18000,1,8999.1913]
>>> y = [18000,18000,1,9000.5]
>>> stats.pearsonr(x,y)
(0.99999999720381061, 2.7961893911410134e-09)
>>> r = stats.pearsonr(y,x)
>>> percentage = r[0]*100
>>> percentage
99.999999720381055