In python I have a function which has many parameters. I want to fit this function to a data set, but using only one parameter, the rest of the parameters I want to supply o
There is a simpler option if you are willing/able to edit the original function.
Redefine your function as:
def func(x,a):
return a*x*x + b
Then you can simply put it in your loop for parameter b:
for b in xrange(10):
popt,pcov = curve_fit(func, x1, x2)
Caveat: the function needs to be defined in the same script in which it is called for this to work.