点击运行
import numpy as np from scipy.optimize import root def func(x): return x * 2 + 2 * np.cos(x) sol = root(func, 0.3) print(sol)
运行结果 :
正在执行...