import numpy as np
from scipy.optimize import curve_fit

def func(X, a, b, c):
    x, y = X
return np.log(a) + b * np.log(x) + c * np.log(y)
x = np.linspace(0.1, 1.1, 101)
y = np.linspace(1.0, 2.0, 101)
a, b, c = 10.0, 4.0, 6.0
z = func((x, y), a, b, c) * 1 + np.random.random(101) / 100
p0 = 8.0, 2.0, 7.0
print(curve_fit(func, (x, y), z, p0))
Python curve_fit with multiple independent variables