{ } Raw JSON

bundles / scipy 1.17.1 / scipy / signal / _peak_finding / _boolrelextrema

function

scipy.signal._peak_finding:_boolrelextrema

source: /scipy/signal/_peak_finding.py :22

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 : ndarray

Array in which to find the relative extrema.

comparator : callable

Function to use to compare two data points. Should take two arrays as arguments.

axis : int, optional

Axis over which to select from data. Default is 0.

order : int, optional

How many points on each side to use for the comparison to consider comparator(n,n+x) to be True.

mode : str, optional

How 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 : ndarray

Boolean array of the same shape as data that 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

argrelmax
argrelmin

Aliases

  • scipy.signal._peak_finding._boolrelextrema