【问题标题】:Fix for downloading Stock Data from Yahoo Finance修复从雅虎财经下载股票数据
【发布时间】:2017-10-20 09:17:19
【问题描述】:

我正在尝试使用 Python 从 Yahoo Finance 下载 DJIA 数据。

from pandas_datareader import data as pdr
import fix_yahoo_finance as yf # Fix for downloading financial data from Yahoo, as the Pyhton Yahoo API has stopped working

yf.pdr_override()

djia = pdr.get_data_yahoo("^DJI", start="2017-10-20", end="2015-10-20")

但我得到了这个错误

Auto-overriding of pandas_datareader's get_data_yahoo() is deprecated and no longer available.

我可以通过其他方式从 Yahoo 下载 DJIA 数据吗?

【问题讨论】:

  • 我认为他们停止了提供数据的服务。用 quandl 试一次
  • 哦嗬!获取索引数据的任何其他方式。从 Google 财经中提取似乎不起作用。
  • 是的,尝试安装 quandl quandl.comquandl.get("BCB/UDJIAD1") 可能会工作

标签: python pandas yahoo-finance yahoo-api


【解决方案1】:
import fix_yahoo_finance as yf
import datetime as dt
start = dt.datetime(2012,5,31)
end = dt.datetime(2018,5,31)
data = yf.download('DIA',start = start,end = end)

此代码可用于从 yahoo Finance 下载 DIA 数据。

你不需要使用 pandas_datareader

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-03
    • 2015-06-11
    • 2019-09-12
    • 1970-01-01
    • 2013-11-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多