summaryrefslogtreecommitdiff
path: root/numpy/ma
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2010-01-06 08:38:14 +0000
committerpierregm <pierregm@localhost>2010-01-06 08:38:14 +0000
commitd24bb94187bcba39911a93aa76582e02cfef5e20 (patch)
tree9021003bbb0dd60a73a2327ff965a0931075c8e5 /numpy/ma
parent4717bd039c85c36ac173dec6e772d2c5531735c7 (diff)
downloadnumpy-d24bb94187bcba39911a93aa76582e02cfef5e20.tar.gz
* Switch the order of optional parameters in ma.argsort for compatibiity w/ np.argsort (bug #1349)
Diffstat (limited to 'numpy/ma')
-rw-r--r--numpy/ma/core.py3
-rw-r--r--numpy/ma/tests/test_core.py6
2 files changed, 6 insertions, 3 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index de8512831..bb013ef5e 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -4743,8 +4743,7 @@ class MaskedArray(ndarray):
round.__doc__ = ndarray.round.__doc__
#............................................
- def argsort(self, axis=None, fill_value=None, kind='quicksort',
- order=None):
+ def argsort(self, axis=None, kind='quicksort', order=None, fill_value=None):
"""
Return an ndarray of indices that sort the array along the
specified axis. Masked values are filled beforehand to
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index 700f99ba2..eb01e23cc 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -2270,7 +2270,11 @@ class TestMaskedArrayMethods(TestCase):
dtype=[('A', int), ('B', int)])
assert_equal(test, b)
assert_equal(test.mask, b.mask)
- #
+
+ def test_argsort(self):
+ "Test argsort"
+ a = array([1, 5, 2, 4, 3], mask=[1, 0, 0, 1, 0])
+ assert_equal(np.argsort(a), argsort(a))
def test_squeeze(self):