[SciPy-user] single elements and arrays

Robert Kern robert.kern@gmail....
Mon Jun 30 13:57:18 CDT 2008


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.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco


More information about the SciPy-user mailing list