Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created November 15, 2016 10:52
Show Gist options
  • Save marketcalls/0256e8d6701a95f9c3d8e21d96ed8b66 to your computer and use it in GitHub Desktop.
Save marketcalls/0256e8d6701a95f9c3d8e21d96ed8b66 to your computer and use it in GitHub Desktop.
Fetch the Stock Data from the dataframe
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