Python Pandas Google Datareader仅返回1年的股票数据
它过去可以提取15年的数据,而不是只返回1年的数据,不管您的“开始”日期如何。还有其他人有这个问题吗?我正在使用spyder作为IDE。我做了以下工作,现在对我有效:Python Pandas Google Datareader仅返回1年的股票数据,python,pandas,stock,Python,Pandas,Stock,它过去可以提取15年的数据,而不是只返回1年的数据,不管您的“开始”日期如何。还有其他人有这个问题吗?我正在使用spyder作为IDE。我做了以下工作,现在对我有效: 右键单击“wb.DataReader(符号,'google',start,end)”中的DataReader并选择“转到定义” 在打开的页面顶部,右键单击“pandas_datareader.google.daily import GoogleDailyReader”中的GoogleDailyReader,然后选择“转到定义” 在
另一个解决方案是为GoogleDailyReader创建一个包装,并更改此包装中的URL:
from pandas_datareader.google.daily import GoogleDailyReader
class FixedGoogleDailyReader(GoogleDailyReader):
@property
def url(self):
return 'http://finance.google.com/finance/historical'
start = datetime.datetime(2012, 1, 1)
end = datetime.datetime.now()
reader = FixedGoogleDailyReader(symbols=['AMZN', 'IBM'], start=start, end=end, chunksize=25, retry_count=3, pause=0.001, session=None)
reader.read()
也许是“谷歌”方面的问题?可能是。我曾经用过雅虎,他们一起禁用了他们的API是的,我不久前试过,但两个都不行。您可以使用,但时间范围较小,谢谢您的想法。我会尝试一下的,谢谢!!你是怎么想出来的?