def portfolio_vol(weights, covmat):
    '\n    Computes the vol of a portfolio from a covariance matrix and constituent weights\n    weights are a numpy array or N x 1 maxtrix and covmat is an N x N matrix\n    '
    vol = (((weights.T @ covmat) @ weights) ** 0.5)
    return vol
Computes the vol of a portfolio from a covariance matrix and constituent weights
weights are a numpy array or N x 1 maxtrix and covmat is an N x N matrix
def portfolio_vol(weights, covmat):
    '\n    Computes the vol of a portfolio from a covariance matrix and constituent weights\n    weights are a numpy array or N x 1 maxtrix and covmat is an N x N matrix\n    '
    vol = (((weights.T @ covmat) @ weights) ** 0.5)
    return vol