Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News Sign UpSign In
| Download
Views: 140
Kernel: Python 3 (old Anaconda 3)
from scipy import optimize def f(x): return 3 * (1 - x) + (x - 2)**2 res = optimize.minimize_scalar(f) print(res.x) print(f(res.x))
3.5000000000000004 -5.25