[SciPy-user] single elements and arrays

Yosef Meller yosefmel at post.tau.ac.il
Tue Jul 1 01:09:08 EDT 2008


On Monday 30 June 2008 21:57:18 Robert Kern wrote:
> On Mon, Jun 30, 2008 at 13:14, Gideon Simpson <grs2103 at 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