fork(1) download
  1. from scipy import stats
  2.  
  3. x = [2019,2020,2021,2022]
  4. y = [161000,182000,257000,282000]
  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(2023))
Success #stdin #stdout 0.53s 64912KB
stdin
Standard input is empty
stdout
330000.0