Sort a complex array using the real part first, then the imaginary part.
Parameters: | a : array_like
|
---|---|
Returns: | out : complex ndarray
|
Examples
>>> np.sort_complex([5, 3, 6, 2, 1])
array([ 1.+0.j, 2.+0.j, 3.+0.j, 5.+0.j, 6.+0.j])
>>> np.sort_complex([5 + 2j, 3 - 1j, 6 - 2j, 2 - 3j, 1 - 5j])
array([ 1.-5.j, 2.-3.j, 3.-1.j, 5.+2.j, 6.-2.j])