title: Pass tuple as input argument for scipy.optimize.curve_fit
body: <p>I have the following code:</p>
  
  <pre><code>import numpy as np
  from scipy.optimize import curve_fit
  
  
  def func(x, p): return p[0] + p[1] + x
  
  
  popt, pcov = curve_fit(func, np.arange(10), np.arange(10), p0=(0, 0)) 
  </code></pre>
  
  <p>It will raise <strong>TypeError: func() takes exactly 2 arguments (3 given)</strong>. Well, that sounds fair - curve_fit unpact the (0, 0) to be two scalar inputs. So I tried this:</p>
  
  <pre><code>popt, pcov = curve_fit(func, np.arange(10), np.arange(10), p0=((0, 0),))
  </code></pre>
  
  <p>Again, it said: <strong>ValueError: object too deep for desired array</strong></p>
  
  <p>If I left it as default (not specifying p0):</p>
  
  <pre><code>popt, pcov = curve_fit(func, np.arange(10), np.arange(10))  
  </code></pre>
  
  <p>It will raise <strong>IndexError: invalid index to scalar variable.</strong> Obviously, it only gave the function a scalar for p.</p>
  
  <p>I can make def func(x, p1, p2): return p1 + p2 + x to get it working, but with more complicated situations the code is going to look verbose and messy. I'd really love it if there's a cleaner solution to this problem.</p>
  
  <p>Thanks!</p>