def summary_stats(r, riskfree_rate=0.03):
    '\n    Return a DataFrame that contains aggregated summary stats for the returns in the columns of r\n    '
    ann_r = annualize_rets(r)
    ann_vol = annualize_vol(r)
    ann_sr = sharpe_ratio(r, riskfree_rate=riskfree_rate)
    dd = r.aggregate((lambda r: drawdown(r).Drawdown.min()))
    skew = r.aggregate(skewness)
    kurt = r.aggregate(kurtosis)
    cf_var5 = r.aggregate(var_gaussian, modified=True)
    hist_cvar5 = r.aggregate(cvar_historic)
    return pd.DataFrame({'Annualized Return': ann_r, 'Annualized Vol': ann_vol, 'Skewness': skew, 'Kurtosis': kurt, 'Cornish-Fisher VaR (5%)': cf_var5, 'Historic CVaR (5%)': hist_cvar5, 'Sharpe Ratio': ann_sr, 'Max Drawdown': dd})
Return a DataFrame that contains aggregated summary stats for the returns in the columns of r
def summary_stats(r, riskfree_rate=0.03):
    '\n    \n    '
    ann_r = annualize_rets(r)
    ann_vol = annualize_vol(r)
    ann_sr = sharpe_ratio(r, riskfree_rate=riskfree_rate)
    dd = r.aggregate((lambda r: drawdown(r).Drawdown.min()))
    skew = r.aggregate(skewness)
    kurt = r.aggregate(kurtosis)
    cf_var5 = r.aggregate(var_gaussian, modified=True)
    hist_cvar5 = r.aggregate(cvar_historic)
    return pd.DataFrame({'Annualized Return': ann_r, 'Annualized Vol': ann_vol, 'Skewness': skew, 'Kurtosis': kurt, 'Cornish-Fisher VaR (5%)': cf_var5, 'Historic CVaR (5%)': hist_cvar5, 'Sharpe Ratio': ann_sr, 'Max Drawdown': dd})