Created
September 13, 2020 19:27
-
-
Save shashankvemuri/afe85096ef858dbbdf42985eabfd0cf6 to your computer and use it in GitHub Desktop.
top absolute correlations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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