Created
November 15, 2016 10:52
-
-
Save marketcalls/0256e8d6701a95f9c3d8e21d96ed8b66 to your computer and use it in GitHub Desktop.
Fetch the Stock Data from the dataframe
This file contains hidden or 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
d= pd.DataFrame() | |
j=0 | |
for i in sym: | |
result = get_price_history(stock=i, start=date(2016,10,1), end=date(2016,11,15)) | |
if result.empty: | |
pass | |
else: | |
s2=result[['Close']] | |
s2=s2.rename(columns = {'Close':i}) | |
if j==0: | |
d=d.append(s2) | |
j=j+1 | |
else: | |
d=d.join(s2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment