Float error


I have defined a sigmoid function with some parameters:

def func_fit_eff1(x, par):
if par[1] != 0: #if statement in order to avoid zero devision error
return 1./(1.+ROOT.TMath.Exp(-((float(x[0]))-float(par[0]))/float(par[1])))

Even though I define the the parameters as floats, I still get the error:

TypeError: a float is required

How can I fix this?


No running example and formatting off, so just guess: par[1] == 0 make return None. Add else return some float.