linregress fits a simple straight line to paired x and y data. It estimates the slope and intercept, then returns related statistics for judging the relationship. section 7.7
Temperature and sports-drink sales
Pass temperature and sales arrays to scipy.stats.linregress, then unpack its results. For the example data, the slope is 9.74: sales increase by about 9.74 units per Fahrenheit degree. The intercept is -405.26, while Pearson correlation is 0.9889, the p-value is 0.0000000654, and the slope standard error is 0.5173. A strong fit can still mislead: ten observations are few, and predictions beyond the observed temperature range may generalize poorly. section 7.7
