Wednesday, April 27, 2022

[FIXED] How to suppress matplotlib warning?

Issue

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: 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


Solution

You can suppress all warnings:

import warnings
warnings.filterwarnings("ignore")

import pandas


Answered By - Andre
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.