Python AttributeError:模块“yahoo_finance”没有“download”属性
我正在学习时间序列课程。并试图访问雅虎金融。但错误如下:Python AttributeError:模块“yahoo_finance”没有“download”属性,python,pandas,yahoo-finance,Python,Pandas,Yahoo Finance,我正在学习时间序列课程。并试图访问雅虎金融。但错误如下: import yahoo_finance as yfinance raw_data = yfinance.download (tickers = "^GSPC ^FTSE ^N225 ^GDAXI", #The time #series we are interested in - (in our case, these are the S&P, FTSE, NIKKEI and DAX) start = "1994-01-0
import yahoo_finance as yfinance
raw_data = yfinance.download (tickers = "^GSPC ^FTSE ^N225 ^GDAXI", #The time
#series we are interested in - (in our case, these are the S&P, FTSE, NIKKEI and DAX)
start = "1994-01-07", #The starting date of our data set
end = "2019-09-27", #The ending date of our data set (at the time of
# upload, this is the current date)
interval = "1d", #The distance in time between two recorded observations.
#Since we're using daily closing prices, we set it equal
#to "1d", which indicates 1 day.
group_by = 'ticker', #The way we want to group the scraped data. Usually we
#want it to be "ticker", so that we have all the
#information about a time series in 1 variable.
auto_adjust = True, #Automatically adjuss the closing prices for each
# period.
treads = True) #Whether to use threads for mass downloading.
请帮忙。问题是,雅虎金融已被熊猫剥夺了权利。另一种选择是修复雅虎财务或使用y-finance Anaconda提示符,键入:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-11-817ad07416bf> in <module>
1 # Using the .download() method to get our data
2
----> 3 raw_data = yfinance.download (tickers = "^GSPC ^FTSE ^N225 ^GDAXI", #The time series we are
interested in - (in our case, these are the S&P, FTSE, NIKKEI and DAX)
4 start = "1994-01-07", #The starting date of our data set
5 end = "2019-09-27", #The ending date of our data set (at the
time of upload, this is the current date)
AttributeError: module 'yahoo_finance' has no attribute 'download'
然后在Anconda提示符/Pycharmn/Jupyter/Spyder等中键入:
python -m pip install yfinance
pip install fix-yahoo-finance
现在你可以像以前一样继续了。yfinance有下载选项我在yahoo_finance中找不到下载方法。你确定有下载方法吗?我解决了这个问题…你也可以使用
import yfinance