This is documentation for an old release of SciPy (version 0.10.0). Read this page in the documentation of the latest stable release (version 1.15.1).
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
>>> vals = [0, 1.3, 1.31, 2.8, 1.25, 2.2, 10.3]
>>> uniq, mult = sp.signal.unique_roots(vals, tol=2e-2, rtype='avg')
Check which roots have multiplicity larger than 1:
>>> uniq[mult > 1]
array([ 1.305])