Determine unique roots and their multiplicities from a list of roots.
Parameters : | p : array_like
tol : float, optional
rtype : {‘max’, ‘min, ‘avg’}, optional
|
---|---|
Returns : | pout : ndarray
mult : ndarray
|
Notes
This utility function is not specific to roots but can be used for any sequence of values for which uniqueness and multiplicity has to be determined. For a more general routine, see numpy.unique.
Examples
>>> from scipy import signal
>>> vals = [0, 1.3, 1.31, 2.8, 1.25, 2.2, 10.3]
>>> uniq, mult = signal.unique_roots(vals, tol=2e-2, rtype='avg')
Check which roots have multiplicity larger than 1:
>>> uniq[mult > 1]
array([ 1.305])