2017-04-16 46 views
1

所以我試圖用代碼here在python中創建一些燭臺圖表。但是,當我運行它,我得到這個錯誤:python中的mathplotlib.finance錯誤

/usr/lib/python3.6/site-packages/matplotlib/cbook.py:136: MatplotlibDeprecationWarning: The finance module has been deprecated in mpl 2.0 and will be removed in mpl 2.2. Please use the module mpl_finance instead. warnings.warn(message, mplDeprecation, stacklevel=1) 

我當然試過

from mpl_finance import candlestick_ohlc 

更換線

from matplotlib.finance import candlestick_ohlc 

,但它仍然無法正常工作。 任何人都知道如何運行代碼?謝謝。

回答

0

棄用警告通常只是警告性警告。您仍應該能夠使用導入的函數(在這種情況下爲candlestick_ohlc),並在其後執行其餘的代碼。

至於爲什麼mpl_finance導入不起作用 - 你安裝了mpl_finance嗎?它似乎在https://github.com/matplotlib/mpl_finance

+0

忘記導入date2num,謝謝。 – Ryunaq