[英]Pandas DataReader is no longer working with the Yahoo Finance API?
我想这个问题是最近才出现的。 在我的普通PC上,我有一个较旧的pandas_datareader
版本,该版本可以正常工作,但是在我的实例上,我必须安装较新的版本,但它不起作用。 它具有以下错误-
Yahoo Daily has been immediately deprecated due to large breaks in the API without the introduction of a stable replacement. Pull Requests to re-enable these data connectors are welcome.
我可以以某种方式安装早期版本吗? 如何使用以下代码解决此问题?
import pandas_datareader as web
import datetime
co = web.DataReader("AAPL", "yahoo", datetime.date.today() - datetime.timedelta(days=10), datetime.date.today())
print co.head()
我编写了此程序包以从新的API https://query1.finance.yahoo.com读取
from datetime import datetime
import py_yahoo_prices.price_fetcher as pf
st_dt = datetime(2017, 6, 1)
comp_codes = ["IMM.L", "AAPL", "TSLA", ....]
# get the raw prices from yahoo, auto retries on a 401 error
raw_prices = pf.multi_price_fetch(code=comp_codes, start_date=st_dt)
只需转到pandas_datareader的PyPi,下载tar.gz文件( wget <url to tar.gz file for 0.5.0>
),然后键入pip install blahblah.tar.gz
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.