Calculate the relative extrema of data.
New in version 0.11.0.
Parameters: | data : ndarray
comparator : callable
axis : int, optional
order : int, optional
mode : str, optional
|
---|---|
Returns: | extrema : tuple of ndarrays
|
Examples
>>> 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]))