I am trying to convert a matlab code into Python and need a help with fsolve function. The Matlab function is of form
{[beta0,val,exitflag] = fsolve(@(beta) solve_obj(beta,y,x,z,z1), tb);
}
where, y,x,z and z1 are given arguments and function need to solve for "beta" with tb as the initial guess. y,x are dataframes and z and z1 are boolean arrays.
I am trying to find appropriate replacement in python but I am unable to figure out how to pass the arguments as an input. I tried to use below function.
{from scipy.optimize import fsolve
beta0 = fsolve(solve_obj, tb, (y,x,z,z1))
}
but it gives error that "solve_obj() takes 2 positional arguments but 5 were given"
Can you please suggest how the arguments in form of Dataframe and array can be passed for fsolve in Python