summaryrefslogtreecommitdiff
path: root/numpy/ma/tests
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/ma/tests')
-rw-r--r--numpy/ma/tests/test_core.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index 9c523429a..f13ff3377 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -1122,6 +1122,17 @@ class TestMaskedArrayAttributes(TestCase):
a[1] = 1
assert_equal(a._mask, zeros(10))
+ def test_flat(self):
+ "Test flat on masked_matrices"
+ test = ma.array(np.matrix([[1, 2, 3]]), mask=[0, 0, 1])
+ test.flat = ma.array([3, 2, 1], mask=[1, 0, 0])
+ control = ma.array(np.matrix([[3, 2, 1]]), mask=[1, 0, 0])
+ assert_equal(test, control)
+ #
+ test = ma.array(np.matrix([[1, 2, 3]]), mask=[0, 0, 1])
+ testflat = test.flat
+ testflat[:] = testflat[[2, 1, 0]]
+ assert_equal(test, control)
#------------------------------------------------------------------------------