#Rosenbrock_minimum.py # #This example works with scipy from version 0.7.0 to 0.9.0 # In later versions fmin has been consolidated with other methods # in the minimize function #Python 2.7.3 #Rosenbrock function of 2 variables: def rosenbrock(parms): x,y = parms return (1-x)**2 + 100* (y-x**2)**2 #minimize the function: from scipy.optimize import fmin import numpy as np x0 = np.array([4,-3]) #Start searching at point (4,-3) res = fmin( rosenbrock, x0, xtol= 1e-8 ) print res