def neg_sharpe(weights, riskfree_rate, er, cov):
    '\n        Returns the negative of the sharpe ratio\n        of the given portfolio\n        '
    r = portfolio_return(weights, er)
    vol = portfolio_vol(weights, cov)
    return ((- (r - riskfree_rate)) / vol)
Returns the negative of the sharpe ratio
of the given portfolio
def neg_sharpe(weights, riskfree_rate, er, cov):
    '\n        Returns the negative of the sharpe ratio\n        of the given portfolio\n        '
    r = portfolio_return(weights, er)
    vol = portfolio_vol(weights, cov)
    return ((- (r - riskfree_rate)) / vol)