from scipy import stats
x = [1,2,5,8,10,12,20,19]
y = [87,100,80,75,80,50,100,97]
slope,intercept,r,p,std_err = stats.linregress(x,y)
def myfunc(x):
return slope * x + intercept
print(myfunc(20))
ZnJvbSBzY2lweSBpbXBvcnQgc3RhdHMKCnggPSBbMSwyLDUsOCwxMCwxMiwyMCwxOV0KeSA9IFs4NywxMDAsODAsNzUsODAsNTAsMTAwLDk3XQoKc2xvcGUsaW50ZXJjZXB0LHIscCxzdGRfZXJyID0gc3RhdHMubGlucmVncmVzcyh4LHkpCgpkZWYgbXlmdW5jKHgpOgogICByZXR1cm4gc2xvcGUgKiB4ICsgaW50ZXJjZXB0CgpwcmludChteWZ1bmMoMjApKQ==