title: scipy curve_fit error: divide by zero encountered
body: <p>I've been trying to fit a function to some data for a while using scipy.optimize.curve_fit:</p>
  
  <pre><code>from __future__ import (print_function,
                      division,
                      unicode_literals,
                      absolute_import)
  import numpy as np
  from scipy.optimize import curve_fit
  import matplotlib.pyplot as mpl
  x = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,     20, 21, 22, 23, 24, 25, 26, 27, 28, 29])
  y = np.array([20.8, 20.9, 22.9, 25.2, 26.9, 28.3, 29.5, 30.7, 31.8, 32.9, 34.0, 35.3, 36.4, 37.5, 38.6, 39.6, 40.6, 41.6, 42.5, 43.2, 44.2, 45.0, 45.8, 46.5, 47.3, 48.0, 48.6, 49.2, 49.8, 50.4])
  def f(x, a, b, c):
      return a/(1+b*x**c)
  popt, pcov = curve_fit(f, x, y)
  print(popt, np.sqrt(np.diag(pcov)), sep='\n')
  </code></pre>
  
  <p>But there always appears an error:</p>
  
  <pre><code>RuntimeWarning: divide by zero encountered in power
  return a/(1+b*x**c)
  </code></pre>
  
  <p>Maybe someone can help me to avoid it?
  Any help would be much appreciated. Cheers!</p>