用法:
scipy.signal.argrelextrema(data, comparator, axis=0, order=1, mode='clip')
计算数据的相对极值。
- data: ndarray
在其中查找相对极值的数组。
- comparator: 可调用的
用于比较两个数据点的函数。应该将两个数组作为参数。
- axis: 整数,可选
从数据中选择的轴。默认值为 0。
- order: 整数,可选
每边有多少点用于比较认为
comparator(n, n+x)
为真。- mode: str,可选
如何处理向量的边。 ‘wrap’(环绕)或‘clip’(将溢出视为与最后一个(或第一个)元素相同)。默认为‘clip’。见
numpy.take
。
- extrema: ndarray 的元组
整数数组中最大值的索引。
extrema[k]
是数据的轴 k 的索引数组。请注意,即使数据是一维的,返回值也是一个元组。
参数:
返回:
注意:
例子:
>>> from scipy.signal import argrelextrema >>> x = np.array([2, 1, 2, 3, 2, 0, 1, 0]) >>> argrelextrema(x, np.greater) (array([3, 6]),) >>> y = np.array([[1, 2, 1, 2], ... [2, 2, 0, 0], ... [5, 3, 4, 4]]) ... >>> argrelextrema(y, np.less, axis=1) (array([0, 2]), array([2, 1]))
相关用法
- Python scipy.signal.argrelmax用法及代码示例
- Python scipy.signal.argrelmin用法及代码示例
- Python scipy.signal.windows.tukey用法及代码示例
- Python scipy.signal.ZoomFFT用法及代码示例
- Python scipy.signal.oaconvolve用法及代码示例
- Python scipy.signal.lp2hp用法及代码示例
- Python scipy.signal.lfilter_zi用法及代码示例
- Python scipy.signal.firwin用法及代码示例
- Python scipy.signal.symiirorder2用法及代码示例
- Python scipy.signal.symiirorder1用法及代码示例
- Python scipy.signal.correlate2d用法及代码示例
- Python scipy.signal.freqz_zpk用法及代码示例
- Python scipy.signal.windows.gaussian用法及代码示例
- Python scipy.signal.lti用法及代码示例
- Python scipy.signal.ss2tf用法及代码示例
- Python scipy.signal.sawtooth用法及代码示例
- Python scipy.signal.resample用法及代码示例
- Python scipy.signal.windows.get_window用法及代码示例
- Python scipy.signal.cont2discrete用法及代码示例
- Python scipy.signal.lfilter用法及代码示例
注:本文由纯净天空筛选整理自scipy.org大神的英文原创作品 scipy.signal.argrelextrema。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。