bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / signal / _signaltools / _cmplx_sort
function
scipy.signal._signaltools:_cmplx_sort
source: build-install/usr/lib/python3.14/site-packages/scipy/signal/_signaltools.py:3062
Signature
def _cmplx_sort(p)Summary
Sort roots based on magnitude.
Parameters
p: array_likeThe roots to sort, as a 1-D array.
Returns
p_sorted: ndarraySorted roots.
indx: ndarrayArray of indices needed to sort the input
p.
Examples
from scipy.signal._signaltools import _cmplx_sort vals = [1, 4, 1+1.j, 3] p_sorted, indx = _cmplx_sort(vals) p_sorted indx✓
array([0, 2, 3, 1])
Aliases
scipy.signal._signaltools._cmplx_sort