summaryrefslogtreecommitdiff
path: root/numpy/ma/tests
diff options
context:
space:
mode:
authorJulian Taylor <juliantaylor108@gmail.com>2018-03-31 10:48:41 +0200
committerGitHub <noreply@github.com>2018-03-31 10:48:41 +0200
commit256c6fcd5842c3b9aa897f37c868ba8f0c67b26c (patch)
treec80ac82a812d9767a1da21af84124d4d9dc23c95 /numpy/ma/tests
parent7fd2a3931021fecd00a8c3d98230c2f2bf78bb46 (diff)
parent4a2891748ab9ac8cafd7aaef10222c761e96f892 (diff)
downloadnumpy-256c6fcd5842c3b9aa897f37c868ba8f0c67b26c.tar.gz
Merge pull request #10786 from lakshayg/stablesort
ENH: Add "stablesort" option to inp.sort as an alias for "mergesort".
Diffstat (limited to 'numpy/ma/tests')
-rw-r--r--numpy/ma/tests/test_core.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index 4c6bb2b42..ff1e087b5 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -3200,6 +3200,12 @@ class TestMaskedArrayMethods(object):
assert_equal(sortedx._data, [1, 2, -2, -1, 0])
assert_equal(sortedx._mask, [1, 1, 0, 0, 0])
+ def test_stable_sort(self):
+ x = array([1, 2, 3, 1, 2, 3], dtype=np.uint8)
+ expected = array([0, 3, 1, 4, 2, 5])
+ computed = argsort(x, kind='stable')
+ assert_equal(computed, expected)
+
def test_argsort_matches_sort(self):
x = array([1, 4, 2, 3], mask=[0, 1, 0, 0], dtype=np.uint8)