{ } Raw JSON

bundles / numpy 2.4.4 / numpy / sort_complex

_ArrayFunctionDispatcher

numpy:sort_complex

source: /numpy/lib/_function_base_impl.py :1859

Signature

def   sort_complex ( a )

Summary

Sort a complex array using the real part first, then the imaginary part.

Parameters

a : array_like

Input array

Returns

out : complex ndarray

Always returns a sorted complex array.

Examples

import numpy as np
np.sort_complex([5, 3, 6, 2, 1])
np.sort_complex([1 + 2j, 2 - 1j, 3 - 2j, 3 - 3j, 3 + 5j])

Aliases

  • numpy.sort_complex