[SciPy-user] Extrema finding
dan collins uchsc
Thu Oct 9 09:33:19 CDT 2008
I use the following technique to fine minima and maxima.
x = 1d vector
y = x; y = delete(y, , axis=0); y = append(y,0)
xy = x-y
a = 
for i in range(0, size(xy)):
a = append(a,xy[i]-xy[i+1])
minima = where(a == 2)
maximu = where(a == -2)
> Message: 7
> Date: Thu, 9 Oct 2008 12:44:16 +0100
> From: iCy-fLaME <firstname.lastname@example.org>
> Subject: [SciPy-user] Extrema finding
> To: "SciPy Users List" <email@example.com>
> Content-Type: text/plain; charset=UTF-8
> I am trying to find a list of all maxima and minima, each for a given
> (1D) numpy array. Anyone know of a quick way to do it?
> Ideally the function will return the extrema values and their
> positions. Relatively simple function to implement in Python, but that
> would be painfully slow. The typical data array I am looking at, has
> approximately 500k elements of double precision float.
> Any thoughts and suggestions are much appreciated. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-user