pandas 熊猫数据阅读器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43665016/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Pandas DataReader
提问by Bruno
This may be a really simple question but I am truly stuck. I am trying to call Pandas' DataReader like:
这可能是一个非常简单的问题,但我真的被困住了。我正在尝试调用 Pandas 的 DataReader,例如:
from pandas.io.date import DataReader
but it does not get DataReader. I do not know what I am doing wrong, especially for such a simple thing. All I am trying to do is to acquire data from Yahoo Finance.
但它没有得到 DataReader。我不知道我做错了什么,尤其是对于这么简单的事情。我要做的就是从雅虎财经获取数据。
Thanks a lot for the help.
非常感谢您的帮助。
回答by zhqiat
Pandas data reader was removed from pandas, it is now a separate repo and a separate install
Pandas 数据读取器已从 Pandas 中删除,现在是一个单独的 repo 和单独的安装
https://github.com/pydata/pandas-datareader
https://github.com/pydata/pandas-datareader
From the readme.
从自述文件。
Starting in 0.19.0, pandas no longer supports pandas.io.data or pandas.io.wb, so you must replace your imports from pandas.io with those from pandas_datareader:
从 0.19.0 开始,pandas 不再支持 pandas.io.data 或 pandas.io.wb,因此您必须将来自 pandas.io 的导入替换为来自 pandas_datareader 的导入:
from pandas.io import data, wb # becomes
from pandas_datareader import data, wb
Many functions from the data module have been included in the top level API.
来自数据模块的许多功能已包含在顶级 API 中。
import pandas_datareader as pdr
pdr.get_data_yahoo('AAPL')