繁体   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