def __max_by_min_sharpe(weights, xs_avg, covariance_matrix):
    ' Anonymous function to compute sharpe ratio, note that since scipy only minimizes we go negative. '
    pm = portfolio_metrics(weights, xs_avg, covariance_matrix)
    return ((- pm['return']) / pm['stdv'])
Anonymous function to compute sharpe ratio, note that since scipy only minimizes we go negative.
def __max_by_min_sharpe(weights, xs_avg, covariance_matrix):
    '  '
    pm = portfolio_metrics(weights, xs_avg, covariance_matrix)
    return ((- pm['return']) / pm['stdv'])