[SciPy-User] nan handling by scipy.optimize

Alan G Isaac alan.isaac@gmail....
Wed Jul 25 19:21:40 CDT 2012

On 7/25/2012 6:07 PM, Pauli Virtanen wrote:
> There are no code changes in Scipy 0.8.0b1...v0.10.1 (which are
> the versions I guess apply for your issue, please clarify) for
> the `bisect` and `brentq` routines.

Thank you for confirming.
I am using 10.1.
I'll check my student's version.
My student is using the EPD for Mac,
the distro with Python 2.6.5.
I'll seek more details if needed.

I encountered two oddities.

1. The same code behaved differently in
the two settings.
2. brentq was returning a zero even though
that was outside the bound we provided (1e-04,10).

Should brentq be able to return a number outside
the bound?  Is there any unusual circumstance that
might cause brentq to return a 0?

If I changed the bound to (1e-02,10) so that it
was bounded slightly slightly farther than zero,
then I was able to get a good match to my student's results.
(Again, changing only this but otherwise using the *same* code.)


More information about the SciPy-User mailing list