title: 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
body: <p>How would i fit a straight line and a quadratic to the data set below using the leastsq function from scipy.optimize? I know how to use polyfit to do it. But i need to use leastsq function.</p>
  
  <p>Here are the x and y data sets:</p>
  
  <pre><code>x: 1.0,2.5,3.5,4.0,1.1,1.8,2.2,3.7
  
  y: 6.008,15.722,27.130,33.772,5.257,9.549,11.098,28.828
  </code></pre>
  
  <p>Can someone help me out please? </p>