Suppressing Pandas dataframe plot output
<p>I am plotting a dataframe:</p>

<pre><code>        ax = df.plot()
        fig = ax.get_figure()
        fig.savefig("{}/{}ts.png".format(IMGPATH, series[pfxlen:]))
</code></pre>

<p>It works fine.  But, on the console, I get:</p>

<pre><code>/usr/lib64/python2.7/site-packages/matplotlib/axes.py:2542: UserWarning: Attempting to set identical left==right results in singular transformations; automatically expanding. left=736249.924955, right=736249.924955 + 'left=%s, right=%s') % (left, right))
</code></pre>

<p>Basic searching hasn't showed me how to solve this error.  So, I want to suppress these errors, since they garbage up the console.  How can I do this?</p>

<p>Those aren't errors, but warnings. If you aren't concerned by those and just want to silence them, it's as simple as:</p>

<pre><code>import warnings
warnings.filterwarnings('ignore')
</code></pre>

<p>Additionally, pandas and other libraries may trigger NumPY floating-point errors. If you encounter those, you have to silence them as well:</p>

<pre><code>import numpy as np
np.seterr('ignore')
</code></pre>

python pandas