-
-
Save zoq/8a4976c2bb4a1d82a0e09cb535ffc063 to your computer and use it in GitHub Desktop.
data.py
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
import numpy as np | |
import pandas as pd | |
from pandas_datareader import data | |
test = data.DataReader(['TSLA', 'FB', 'SPY', 'VWO'], 'yahoo', start='2017/01/01', end='2021/03/30') | |
print(test.head()) | |
test = test['Adj Close'] | |
returns = np.log(test/test.shift(1)) | |
returns.to_csv('test.csv') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment