【发布时间】:2017-05-23 13:51:32
【问题描述】:
我已成功从 Google 财经下载股票数据,如下所示:
import pandas as pd
from pandas_datareader import data as web
import datetime
start = datetime.datetime(2016,1,1)
end = datetime.date.today()
apple = web.DataReader('aapl', 'google', start, end)
我认为我可以对索引数据使用相同的框架。但这不起作用:
spx = web.DataReader('INDEXSP', 'google', start, end)
RemoteDataError: Unable to read URL: http://www.google.com/finance/historical
Google 不支持此索引吗?
或者我需要不同的协议吗?
【问题讨论】:
-
我也在为此苦苦挣扎。最终,我只是去寻找 csv 格式的数据下载,然后使用 pd.read_csv 将其导入 python
标签: python yahoo-finance quantitative-finance google-finance google-finance-api