You are viewing an older version (2.4.3).Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.4.3 / numpy / ma / core / sort

function

numpy.ma.core:sort

source: /numpy/ma/core.py:7215

Signature

def sort(a, axis = -1, kind = None, order = None, endwith = True, fill_value = None, *, stable = None)

Summary

Return a sorted copy of the masked array.

Extended Summary

Equivalent to creating a copy of the array and applying the MaskedArray sort() method.

Refer to MaskedArray.sort for the full documentation

Examples

import numpy as np
import numpy.ma as ma
x = [11.2, -3.973, 0.801, -1.41]
mask = [0, 0, 0, 1]
masked_x = ma.masked_array(x, mask)
masked_x
ma.sort(masked_x)

See also

MaskedArray.sort

equivalent method

Aliases

  • numpy.ma.sort