def annualize_ret(returns, periods):
    """
    Annualizes a set of returns
    """
    cum_ret = (1 + returns).prod()
    n_periods = returns.shape[0]
    return cum_ret ** (periods / n_periods) - 1