summaryrefslogtreecommitdiff
path: root/numpy/ma/tests
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2010-01-12 21:07:07 +0000
committerpierregm <pierregm@localhost>2010-01-12 21:07:07 +0000
commit5efba97f7e3c0734ed8367c97e02958f18bb575f (patch)
tree3e7b148ebb4fa327d53bca3bb00c010091237c53 /numpy/ma/tests
parentd24bb94187bcba39911a93aa76582e02cfef5e20 (diff)
downloadnumpy-5efba97f7e3c0734ed8367c97e02958f18bb575f.tar.gz
* fix methods using axis when the mask is nomask (from 1.4.x r8041)
Diffstat (limited to 'numpy/ma/tests')
-rw-r--r--numpy/ma/tests/test_core.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index eb01e23cc..ada858b01 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -2627,6 +2627,26 @@ class TestMaskedArrayMathMethods(TestCase):
assert_equal(out, control)
+ def test_axis_methods_nomask(self):
+ "Test the combination nomask & methods w/ axis"
+ a = array([[1, 2, 3], [4, 5, 6]])
+ #
+ assert_equal(a.sum(0), [5, 7, 9])
+ assert_equal(a.sum(-1), [6, 15])
+ assert_equal(a.sum(1), [6, 15])
+ #
+ assert_equal(a.prod(0), [4, 10, 18])
+ assert_equal(a.prod(-1), [6, 120])
+ assert_equal(a.prod(1), [6, 120])
+ #
+ assert_equal(a.min(0), [1, 2, 3])
+ assert_equal(a.min(-1), [1, 4])
+ assert_equal(a.min(1), [1, 4])
+ #
+ assert_equal(a.max(0), [4, 5, 6])
+ assert_equal(a.max(-1), [3, 6])
+ assert_equal(a.max(1), [3, 6])
+
#------------------------------------------------------------------------------
class TestMaskedArrayMathMethodsComplex(TestCase):