我对以下问题感到非常困惑。我根本不了解我的计算机如何工作。我有以下代码:import pandas as pd import numpy as npfrom pandas_datareader import data as wd import quandl tickers = ['MSFT','AAPL','F','GE'] new_data_01 = pd.DataFrame() for ii in tickers: new_data_01[ii] = wd.DataReader(ii, data_source = 'yahoo', start ='2001-1-1')['Adj Close']new_data_01.head()当我同时在Spyder和Anaconda笔记本电脑上运行该软件时,效果很好。但是,当我在IDLE中运行它时,情况并非如此。我不明白为什么。这是我在IDLE中运行代码时遇到的错误... Traceback (most recent call last): File "/Users/andres/Desktop/test.py", line 9, in <module> new_data_01[ii] = wd.DataReader(ii, data_source = 'yahoo', start ='2001-1-1')['Adj Close'] File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas_datareader/data.py", line 291, in DataReader raise ImmediateDeprecationError(DEP_ERROR_MSG.format('Yahoo Daily'))pandas_datareader.exceptions.ImmediateDeprecationError: Yahoo Daily has been immediately deprecated due to large breaks in the API without theintroduction of a stable replacement. Pull Requests to re-enable these dataconnectors are welcome.See https://github.com/pydata/pandas-datareader/issues
1 回答

慕娘9325324
TA贡献1783条经验 获得超4个赞
您能否在两个IDE中提供Pandas Datareader的版本?
import pandas_datareader as pd
print(pd.__version__)
它们可能有所不同,这可以解释您的错误。在Pandas Datareader 6.0版中已弃用Yahoo Finance 。最近恢复了部分API,并在最新的开发版本(Github存储库的master分支)中对其进行了支持。
如果一个IDE的版本不是6.0,则ImmediateDeprecationError在该环境中将无法满足您的请求。我建议从两个IDE的Github存储库中下载最新版本的Pandas Datareader。
添加回答
举报
0/150
提交
取消