fork(1) download
  1. from scipy import stats
  2.  
  3. x = [1,2,5,8,10,12,20,19]
  4. y = [87,100,80,75,80,50,100,97]
  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(myfunc(12))
Success #stdin #stdout 0.41s 65280KB
stdin
Standard input is empty
stdout
84.22808243101642