title: How to fit a function using mpmath?
body: <p>I was trying to use fit the data points like this:</p>
  <p>This is just an example:（In reality, the calculation involves e^(100000) very large number, so that is the reason I use mpmath because it can deal with extremely large number.）</p>
  <pre><code>xdata = [1,2,3,4,5,6]
  ydata = [1,3,6,9,14,20]
  
  def fit(x,n,k):
      y = mp.exp(n*x)+k
      return y
  
  parameters, covariance = curve_fit(fit, xdata, ydata)
  </code></pre>
  <p>then I got the error</p>
  <blockquote>
  <p>cannot create mpf from array</p>
  </blockquote>
  <p>I searched online but did not get useful solution to fix this?</p>