获得__init __()至少需要4个参数(给定2个)

我一直在第16行获得一个init()至少接受4个参数(给定2个),但我不确定为什么:

    import numpy as np
    from scipy.optimize import minimize


   from scipy.optimize import Bounds
    bounds = Bounds([0,0],[1,1])

    from scipy.optimize import LinearConstraint
    linear_constraint = LinearConstraint([[1,1],[1,1],[0,2],[0,2]])

    def func(x): #optimize 2d function
        return (x[0]/x[1]*(1-x[0])**2)**0.6+((1-(x[0]/x[1]))/(1- 
   x[1])**2)**0.6 + 5*(1/x[1])**0.6

    x0= np.array([1,0.5])
    res = minimize(func, x0, method='trust-constr',
                  constraints = [linear_constraint],
                   options={'verbose': 1}, bounds = Bounds)
    print(res.x) 
评论