center.py

from scipy import optimize
from numpy import array
from random import uniform

n = 50
center = array([uniform(0, 10)
               for i in range(n)])

def f(x):
    return sum((x-center)**2)

optimum = optimize.fmin_bfgs(f, [0]*n)
print optimum - center