[SciPy-User] interpolate.sproot -- Warning: the number of zeros exceeds mest
Moore, Eric (NIH/NIDDK) [F]
eric.moore2 at nih.gov
Thu Sep 18 09:49:31 EDT 2014
From: Nils Wagner [mailto:nils106 at googlemail.com]
Sent: Thursday, September 18, 2014 8:52 AM
To: SciPy Users List
Subject: Re: [SciPy-User] interpolate.sproot -- Warning: the number of zeros exceeds mest
So far I have used
from scipy.interpolate import splrep, splev, sproot
import warnings
warnings.simplefilter("ignore")
but the warning message is still there.
Am I missing something ?
Nils
On Thu, Sep 18, 2014 at 2:43 PM, Daπid <davidmenhur at gmail.com> wrote:
On 18 September 2014 14:32, Nils Wagner <nils106 at googlemail.com> wrote:
How can I suppress the message
Warning: the number of zeros exceeds mest
Is it possible to throw an exception ?
Python's warnings machinery can be used.
https://docs.python.org/2/library/warnings.html
Using warnings.simplefilter('ignore') you will completely silence the warning, and using 'error' instead will raise an exception. You may want to run this in a context, so it doesn't "leak out" on the rest of your program:
with warnings.catch_warnings():
See examples in the docs.
/David.
_______________________________________________
SciPy-User mailing list
SciPy-User at scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
It isn't a warning in that sense. sproot simply calls print. See https://github.com/scipy/scipy/blob/master/scipy/interpolate/fitpack.py#L726
Eric
More information about the SciPy-User
mailing list