正在学习使用 pandas datareader 来绘制雅虎股价但它似乎不正确
Learning to use pandas datareader to plot Yahoo share price but it does not seem right
我正在学习 O'Reilly 课程 - Pandas 开发人员简介。
我用雅虎股价绘制了一张图表。我必须修改给定的代码,因为它已经过时了。
这是 jupyter 笔记本:
https://nbviewer.jupyter.org/github/jeremy886/pydata-notes/blob/master/ipython-notebooks/Time_Series.ipynb
请跳至图表底部。
我将我的图表与作者的图表以及来自 Google 的历史价格进行了比较,发现我的图表与其他图表不同。 (我觉得作者的也和Google的不一样)。
来自 Google 的价格信息:https://www.google.com.tw/search?q=yahoo+price&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=vHJkWNPuKvOm8weq5qrQBw
乍一看,pandas_datareader 来源似乎不正确。例如,我得到的大多数 CLOSE 价格都在 10 美元左右。就像昨天的 12 美元,但 Google 的价格约为 38 美元。
请问是什么问题?
- pandas_datareader 不再值得信赖了吗
- 或者有一些我不明白的调整
- 或者 mine/author 的代码有错误
谢谢,新年快乐。
您正在呼叫 data.DataReader('F', 'yahoo', start, end)
。
来源:
def DataReader(name, data_source=None, start=None, end=None,
retry_count=3, pause=0.001, session=None, access_key=None):
"""
Imports data from a number of online sources.
Currently supports Yahoo! Finance, Google Finance, St. Louis FED (FRED),
Kenneth French's data library, and the SEC's EDGAR Index.
Parameters
----------
name : str or list of strs
the name of the dataset. Some data sources (yahoo, google, fred) will
accept a list of names.
data_source: {str, None}
the data source ("yahoo", "yahoo-actions", "yahoo-dividends",
"google", "fred", "ff", or "edgar-index")
第一个参数是您感兴趣的数据集的名称,在您的例子中是 'F'
Ford。
data_source
参数是您从中获取数据的站点。在你的情况下,'yahoo'
。这与股票价格不同。如果你看一下福特的股价,你会发现它们比你的好。
如有疑问,请阅读文档。如果文档没有帮助,请阅读源代码 - https://github.com/pydata/pandas-datareader
我正在学习 O'Reilly 课程 - Pandas 开发人员简介。
我用雅虎股价绘制了一张图表。我必须修改给定的代码,因为它已经过时了。
这是 jupyter 笔记本: https://nbviewer.jupyter.org/github/jeremy886/pydata-notes/blob/master/ipython-notebooks/Time_Series.ipynb
请跳至图表底部。
我将我的图表与作者的图表以及来自 Google 的历史价格进行了比较,发现我的图表与其他图表不同。 (我觉得作者的也和Google的不一样)。
来自 Google 的价格信息:https://www.google.com.tw/search?q=yahoo+price&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=vHJkWNPuKvOm8weq5qrQBw
乍一看,pandas_datareader 来源似乎不正确。例如,我得到的大多数 CLOSE 价格都在 10 美元左右。就像昨天的 12 美元,但 Google 的价格约为 38 美元。
请问是什么问题?
- pandas_datareader 不再值得信赖了吗
- 或者有一些我不明白的调整
- 或者 mine/author 的代码有错误
谢谢,新年快乐。
您正在呼叫 data.DataReader('F', 'yahoo', start, end)
。
来源:
def DataReader(name, data_source=None, start=None, end=None,
retry_count=3, pause=0.001, session=None, access_key=None):
"""
Imports data from a number of online sources.
Currently supports Yahoo! Finance, Google Finance, St. Louis FED (FRED),
Kenneth French's data library, and the SEC's EDGAR Index.
Parameters
----------
name : str or list of strs
the name of the dataset. Some data sources (yahoo, google, fred) will
accept a list of names.
data_source: {str, None}
the data source ("yahoo", "yahoo-actions", "yahoo-dividends",
"google", "fred", "ff", or "edgar-index")
第一个参数是您感兴趣的数据集的名称,在您的例子中是 'F'
Ford。
data_source
参数是您从中获取数据的站点。在你的情况下,'yahoo'
。这与股票价格不同。如果你看一下福特的股价,你会发现它们比你的好。
如有疑问,请阅读文档。如果文档没有帮助,请阅读源代码 - https://github.com/pydata/pandas-datareader