In [19]:
from scipy.optimize import curve_fit
import numpy as np

def func(x, args*):
    return(m*x[0] + n*x[1] +b)

v, c = curve_fit (func,np.float_([[1,1,2,2],[1,2,1,2]]), np.float_([1,2,3,4]))
e = np.sqrt(np.diag(c))
(v, e)


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-19-fcda63644bed> in <module>()
      5     return(m*x[0] + n*x[1] +b)
      6 
----> 7 v, c = curve_fit (func,np.float_([[1,1,2,2],[1,2,1,2]]), np.float_([1,2,3,4]))
      8 e = np.sqrt(np.diag(c))
      9 (v, e)

/home/lukas.bentkamp/miniconda3/lib/python3.5/site-packages/scipy/optimize/minpack.py in curve_fit(f, xdata, ydata, p0, sigma, absolute_sigma, check_finite, bounds, method, **kwargs)
    604         args, varargs, varkw, defaults = _getargspec(f)
    605         if len(args) < 2:
--> 606             raise ValueError("Unable to determine number of fit parameters.")
    607         n = len(args) - 1
    608     else:

ValueError: Unable to determine number of fit parameters.

In [27]:
z = lambda *a: a[0]**2
import inspect
help(inspect.getargspec)


Help on function getargspec in module inspect:

getargspec(func)
    Get the names and default values of a function's arguments.
    
    A tuple of four things is returned: (args, varargs, keywords, defaults).
    'args' is a list of the argument names, including keyword-only argument names.
    'varargs' and 'keywords' are the names of the * and ** arguments or None.
    'defaults' is an n-tuple of the default values of the last n arguments.
    
    Use the getfullargspec() API for Python 3 code, as annotations
    and keyword arguments are supported. getargspec() will raise ValueError
    if the func has either annotations or keyword arguments.