Created
September 7, 2019 16:58
-
-
Save julian-west/b66319a742d8b8a7c874c19d6ac49050 to your computer and use it in GitHub Desktop.
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
#convert matrix to list of edges and rename the columns | |
edges = correlation_matrix.stack().reset_index() | |
edges.columns = ['asset_1','asset_2','correlation'] | |
#remove self correlations | |
edges = edges.loc[edges['asset_1'] != edges['asset_2']].copy() | |
#show the first 5 rows of the edge list dataframe. | |
edges.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment