Python、Pandas、雅虎财经 API
无法让 Pandas 数据读取器从雅虎 API 检索报价。最新的答案似乎是:
“pip安装--升级pandas pip安装--升级pandas-datareader
但是,目前我将使用 Google Collab 及其 Python 平台,有人知道如何在这里更新 pandas 吗?或者 API 真的刚刚停止使用吗? ?
Having trouble getting Pandas data reader to retrieve price quotes from Yahoo’s API. The most up to date answer seems to be:
"pip install --upgrade pandas pip install --upgrade pandas-datareader
However, for the time being I will be using Google Collab and its Python platform, does anyone know how to update the pandas here? Or has the API truly just been discontinued?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
雅虎 API 对我有用。不确定您使用的是哪种包装器(有很多)。
尝试
yfinance
。来自 Colab:
!pip install yfinance
很棒的文档此处。
Yahoo API works for me. Not sure which wrapper you're using (there are a ton).
Try
yfinance
.From Colab:
!pip install yfinance
Great docs here.
在 Colab 中,您需要在 pip 之前添加
!
In Colab you need to put a
!
before pip好吧,所以我找到了答案!正如 PythonPerfection 上面所说的 ^ 代码确实需要在 pip 之前有一个
!
。然而,Google Colab 仅在 1.3.5 之前更新了 pandas:
检查 Pandas 网站,我可以看到他们实际上有 1.4.1 版本:
https://pandas.pydata.org/pandas-docs/stable/ Whatsnew/index.html
这可能是问题所在 - 但我仍然想知道雅虎是否已经停止使用它的 API?
Okay, so I found the answer! Just as PythonPerfection said above ^ the code does require a
!
before the pip.However, Google Colab only has pandas update up until 1.3.5:
Checking Pandas website I can see they actually have a release up to 1.4.1:
https://pandas.pydata.org/pandas-docs/stable/whatsnew/index.html
This may be the issue - but I would still like to know if Yahoo has discontinued it API?