Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
calc corr
spx_px = close_px_all["SPX"]
spx_rets = spx_px / spx_px.shift(1) -1
returns = close_px.pct_change()
corr = pd.rolling_corr(returns, spx_rets, 125, min_periods=100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.