Define the function one_resample_prediction that generates a bootstrapped sample from the tbl argument, calculates the line of best fit for ycol vs xcol for that resample, and predicts a value based on xvalue.
Hint: Remember you defined the parameters function earlier
def parameters(tbl, colx, coly):
x = tbl.column(colx)
y = tbl.column(coly)
r = correlation(tbl, colx, coly)
x_mean = np.mean(x)
y_mean = np.mean(y)
x_sd = np.std(x)
y_sd = np.std(y)
slope = (y_sd / x_sd) * r
intercept = y_mean - (slope * x_mean)
return make_array(slope, intercept)
def one_resample_prediction(tbl, colx, coly, xvalue):
...
evans_career_length_pred = one_resample_prediction(nfl, "Pick Number", "Career Length", 169)
evans_career_length_pred