Created
September 13, 2020 19:25
-
-
Save shashankvemuri/01a06416cddd5622795e808e638afdb0 to your computer and use it in GitHub Desktop.
correlation
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
dataset = pdr.get_data_yahoo(tickers, start, end)['Adj Close'] | |
stocks_returns = np.log(dataset/dataset.shift(1)) | |
print('\nCorrelation Matrix') | |
corr_matrix = stocks_returns.corr() | |
print (corr_matrix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment