Skip to content

Instantly share code, notes, and snippets.

@shashankvemuri
Created September 13, 2020 19:27
Show Gist options
  • Save shashankvemuri/afe85096ef858dbbdf42985eabfd0cf6 to your computer and use it in GitHub Desktop.
Save shashankvemuri/afe85096ef858dbbdf42985eabfd0cf6 to your computer and use it in GitHub Desktop.
top absolute correlations
def get_top_abs_correlations(df):
au_corr = df.corr().abs().unstack()
labels_to_drop = get_redundant_pairs(df)
au_corr = au_corr.drop(labels=labels_to_drop).sort_values(ascending=False)
return au_corr
print("\nTop Absolute Correlations")
print(get_top_abs_correlations(stocks_returns))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment