Answers for "how to find the correlation in python"

2

correlation python

import numpy as np
import scipy.stats
x = np.arange(15, 20)
y = np.arange(5, 10)
stat, p = scipy.stats.pearsonr(x, y)
Posted by: Guest on March-12-2021
0

how to find correlation in scipy?

>>> result = scipy.stats.linregress(x, y)
>>> result.slope
7.4363636363636365
>>> result.intercept
-85.92727272727274
>>> result.rvalue
0.7586402890911869
>>> result.pvalue
0.010964341301680825
>>> result.stderr
2.257878767543913
Posted by: Guest on June-19-2021

Code answers related to "how to find the correlation in python"

Python Answers by Framework

Browse Popular Code Answers by Language