python中的mpl_finance模块导入错误

问题描述 投票:0回答:1

我尝试过使用from matplotlib.finance import quotes_historical_yahoo_ochl,但发现它已被弃用。因此,我已经安装了mpl_finance并尝试了这个:

from mpl_finance import quotes_historical_yahoo_ochl

但是我收到以下错误:

ImportError: cannot import name 'quotes_historical_yahoo_ochl'

我想检查一下:

dir(mpl_finance)

并找到以下内容:

['Affine2D', 'Line2D', 'LineCollection', 'PolyCollection', 'Rectangle', 'TICKLEFT', 'TICKRIGHT', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_candlestick', '_check_input', '_plot_day_summary', 'absolute_import', 'candlestick2_ochl', 'candlestick2_ohlc', 'candlestick_ochl', 'candlestick_ohlc', 'division', 'index_bar', 'mcolors', 'np', 'plot_day_summary2_ochl', 'plot_day_summary2_ohlc', 'plot_day_summary_oclh', 'plot_day_summary_ohlc', 'print_function', 'unicode_literals', 'volume_overlay', 'volume_overlay2', 'volume_overlay3', 'xrange', 'zip']

请帮助我摆脱这个问题。请。

python python-3.x matplotlib
1个回答
1
投票

由于雅虎停止提供其历史报价服务,quotes_historical_yahoo_ochl功能停止工作。来自It was hence removed代码的mpl_finance完全。

© www.soinside.com 2019 - 2024. All rights reserved.