[SciPy-user] single elements and arrays

Yosef Meller yosefmel@post.tau.ac...
Tue Jul 1 00:09:08 CDT 2008


On Monday 30 June 2008 21:57:18 Robert Kern wrote:
> On Mon, Jun 30, 2008 at 13:14, Gideon Simpson <grs2103@columbia.edu> wrote:
> > foo finds a root where x is a parameter in the equation to be solved.
> > If x is an array, I iterate through the elements of the array.
>
> In that case, just special case it. Use numpy.isscalar() to do the test.

Or else, put this at the beginning:
x = numpy.atleast_1d(x)



More information about the SciPy-user mailing list