[SciPy-User] Brentq return values

Ralf Gommers ralf.gommers at gmail.com
Mon Aug 6 17:28:23 EDT 2012


On Mon, Aug 6, 2012 at 5:07 AM, The Helmbolds <helmrp at yahoo.com> wrote:

> When the brentq routine is called with `full_output` set to `True` it
> returns a tuple.
> The first element of that tuple is the root, i.e., a simple real number.
> So far, so good.
>
> However, the second element of that tuple is:
>     <scipy.optimize.zeros.RootResults object at 0x03B4F450>
> I don't know how to read or "decode" such a thing.
> I'd welcome any instruction on how to do that.
>
> I also observe that perhaps the return value could be more transparent,
> i.e., easy to interpret.
>

The docstring says that (if we call the RootResults instance r) there's an
attribute r.converged. Would be good to show in an example the rest:

        r.root
        r.iterations
        r.function_calls
        r.converged

What those things are seems self-explanatory.

You can find out things like the above by tab completion in IPython for
example. Type r.<TAB> and you'll see what attributes and methods are
present (alternatively, look at the source code).

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20120806/bd1a44f8/attachment.html>


More information about the SciPy-User mailing list