Linear regression with matplotlib / numpy
arange generates lists (well, numpy arrays); type help(np.arange) for the details. You don’t need to call it on existing lists. I should add that I tend to use poly1d here rather than write out “m*x+b” and the higher-order equivalents, so my version of your code would look something like this: