def weight_cw(r, cap_weights, **kwargs):
    '\n    Returns the weights of the CW portfolio based on the time series of capweights\n    '
    w = cap_weights.loc[r.index[1]]
    return (w / w.sum())
Returns the weights of the CW portfolio based on the time series of capweights
def weight_cw(r, cap_weights, **kwargs):
    '\n    \n    '
    w = cap_weights.loc[r.index[1]]
    return (w / w.sum())