### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Routines »
- Sorting and searching »

# numpy.sort_complex

`numpy.``sort_complex`(a)

  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

      >>> 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])

### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Routines »
- Sorting and searching »