This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

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_like

The roots to sort, as a 1-D array.

Returns

p_sorted : ndarray

Sorted roots.

indx : ndarray

Array 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