title: curve_fit : 'numpy.float64' object cannot be interpreted as an integer
body: <p>I'm trying to do a fit with scipy.optimize.curve_fit in this way:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from scipy.optimize import curve_fit
  
  def fitFunc(x, a, b, c, d):     
      return a + b*x + c*x*x + d*x*x*x
  
  y4u = [max(HR5[1801:1820]), max(HR5[1821:1840]), max(HR5[1841:1860]), max(HR5[1861:1880]), \
         max(HR5[1881:1900]), max(HR5[1901:1920]), max(HR5[1921:1940]), max(HR5[1941:1960]), \
         max(HR5[1961:1980]), max(HR5[1981:2000]), max(HR5[2001:2020]), max(HR5[2021:2040]), \
         max(HR5[2041:2060]), max(HR5[2061:2080]), max(HR5[2081:2100])]
  # y4u = [1.0, 1.0, 1.0, 0.33329999999999999, 0.33329999999999999, 0.0, -0.33329999999999999, -0.3, -0.6, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]
  
  zz4u = [0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0]
  
  plt.plot(zz4u, y4u, marker='.', markersize=0, linewidth='0.5', color='navy')
  popt, pcov = curve_fit(fitFunc, zz4u, y4u)
  plt.plot(zz4u, fitFunc(zz4u, *popt), color='gold', linestyle='--')
  </code></pre>
  
  <p>But this give the error: 
  <code>TypeError: 'numpy.float64' object cannot be interpreted as an integer</code>.
  I'm using anaconda3 python. How can i fix that?</p>
  
  <p>Edit: fix indent of a code in <code>fitFunc</code></p>
  
  <p>Edit: the whole log:</p>
  
  <pre><code>/Users/Alessandro/anaconda3/lib/python3.6/site-packages/scipy/optimize/minpack.py:779: OptimizeWarning: Covariance of the parameters could not be estimated
        category=OptimizeWarning)
      Traceback (most recent call last):
        File "untitled.py", line 79, in &lt;module&gt;
          plt.plot(zz4u, fitFunc(zz4u, *popt4), color='gold', linestyle='--')
        File "untitled.py", line 38, in fitFunc
          return a + b*x + c*x*x + d*x*x*x
      TypeError: 'numpy.float64' object cannot be interpreted as an integer
  </code></pre>