from scipy.optimize import minimize
start_pos = np.ones(6) * (1 / 6.0)
cons = {'type': 'eq', 'fun': lambda x: 1 - sum(x)}
bnds = tuple((0, 1) for x in start_pos)
How do I use a minimization function in scipy with constraints