如何抑制matplotlib警告? [英] How to suppress matplotlib warning?
本文介绍了如何抑制matplotlib警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
每次import pandas
时,我都会从matplotlib
得到警告:
I am getting an warning from matplotlib
every time I import pandas
:
/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py:872: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
warnings.warn(self.msg_depr % (key, alt_key))
抑制它的最佳方法是什么?所有软件包都是最新的.
What is the best way to suppress it? All packages are up-to-date.
Conf:带有精酿Python 2.7.10的OSX(默认值,2015年7月13日,12:05:58),pandas == 0.17.0和matplotlib == 1.5.0 >
Conf: OSX with a brew Python 2.7.10 (default, Jul 13 2015, 12:05:58), and pandas==0.17.0 and matplotlib==1.5.0
推荐答案
您可以禁止显示所有警告:
You can suppress all warnings:
import warnings
warnings.filterwarnings("ignore")
import pandas
这篇关于如何抑制matplotlib警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文