簡體   English   中英

如何修復 MatPlotLib 的 mpl_finance 包?

[英]How to fix mpl_finance package for MatPlotLib?

收到此錯誤消息:

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.

我該如何放置mpl_finance包。 我已將其安裝在 pip 中,但正確的導入用語是什么?

import datetime as dt
import matplotlib.pyplot as plt
from matplotlib import style
from matplotlib.finance import candlestick_ohlc
import matplotlib.dates as mdates
import pandas as pd
import pandas_datareader.data as web
from googlefinance import getQuotes
import json
from datetime import datetime
from forex_python.converter import CurrencyRates
from yahoo_finance import Share

matplotlib.finance 的所有代碼都移到了單獨的存儲庫中 這是一個使用示例。 回答你的問題:

from mpl_finance import candlestick_ohlc

要導入通過 pip 安裝的名為x的模塊,您通常希望執行import x

所以在這里

import mpl_finance

或獲得其功能之一,例如

from mpl_finance import candlestick_ohlc

新版本可以在這里找到: https : //pypi.org/project/mplfinance/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM