def rosen(x):
    """The Rosenbrock function"""
return sum(100.0 * (x[1:] - x[:-1] ** 2.0) ** 2.0 + (1 - x[:-1]) ** 2.0)
x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
xopt = optimize.fmin(rosen, x0, xtol=1e-08, disp=True)
print(xopt)
Minimizing python function that has numpy array as argument