How to use leastsq function from scipy.optimize in python to fit both a straight line and a quadratic line to data sets x and y How to use leastsq function from scipy.optimize in python to fit both a straight line and a quadratic line to data sets x and y numpy numpy