Jan-12-2023, 03:46 PM
An indentation error?
for R in returns: constraints = ({'type': 'eq', 'fun': b}, {'type': 'eq', 'fun': lambda w: GR(w) - R}) opt = minimize(minimizeMyvolatility, w0, method = 'SLSQP', bounds = bounds, constraints = constraints) --->volatility_opt.append(opt['fun'])