bundles / scipy 1.17.1 / scipy / signal / _peak_finding / _boolrelextrema
function
scipy.signal._peak_finding:_boolrelextrema
Signature
def _boolrelextrema ( data , comparator , axis = 0 , order = 1 , mode = clip ) Summary
Calculate the relative extrema of data.
Extended Summary
Relative extrema are calculated by finding locations where comparator(data[n], data[n+1:n+order+1]) is True.
Parameters
data: ndarrayArray in which to find the relative extrema.
comparator: callableFunction to use to compare two data points. Should take two arrays as arguments.
axis: int, optionalAxis over which to select from
data. Default is 0.order: int, optionalHow many points on each side to use for the comparison to consider
comparator(n,n+x)to be True.mode: str, optionalHow the edges of the vector are treated. 'wrap' (wrap around) or 'clip' (treat overflow as the same as the last (or first) element). Default 'clip'. See numpy.take.
Returns
extrema: ndarrayBoolean array of the same shape as
datathat is True at an extrema, False otherwise.
Examples
import numpy as np from scipy.signal._peak_finding import _boolrelextrema testdata = np.array([1,2,3,2,1])✓
_boolrelextrema(testdata, np.greater, axis=0)
✗See also
Aliases
-
scipy.signal._peak_finding._boolrelextrema