fork(1) download
  1. from scipy import stats
  2.  
  3. x = [5,7,8,7,2,17,2,9]
  4. y = [99,86,87,88,111,86,103,87]
  5.  
  6. slope,intercept,r,p,std_err = stats.linregress(x,y)
  7.  
  8. def myfunc(x):
  9. return slope * x + intercept
  10.  
  11. print(r)
Success #stdin #stdout 0.53s 64956KB
stdin
Standard input is empty
stdout
-0.7457858668854439