我對以下問題感到非常困惑。我根本不了解我的計算機如何工作。我有以下代碼: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
提交
取消