如何抑制matplotlib警告?

发布于 2021-01-29 18:38:15

matplotlib每次我都会收到警告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))

抑制它的最佳方法是什么?所有软件包都是最新的。

Conf: OSX带有Brew Python 2.7.10(默认,2015年7月13日,12:05:58),pandas ==
0.17.0和matplotlib == 1.5.0

关注者
0
被浏览
41
1 个回答
  • 面试哥
    面试哥 2021-01-29
    为面试而生,有面试问题,就找面试哥。

    您可以禁止所有警告:

    import warnings
    warnings.filterwarnings("ignore")
    
    import pandas
    


知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看