To print all warnings in numpy do the following
import numpy as np
np.seterr(all='print')
This will print all warnings to stderr.
You can also make warnings to exceptions.
An example is shown below. The documentation is here.
import numpy as np
np.seterr(all='print')
This will print all warnings to stderr.
You can also make warnings to exceptions.
An example is shown below. The documentation is here.
import numpy numpy.seterr(all='raise') s = 10000.0 try: x = numpy.exp(s) print x except: print "That is too big!"
No comments:
Post a Comment