summaryrefslogtreecommitdiff
path: root/numpy/ma/tests/test_extras.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-05-05 21:11:39 +0100
committerEric Wieser <wieser.eric@gmail.com>2017-05-05 21:46:58 +0100
commit36e7513edd1114c3f928be66953d4349273122c0 (patch)
treec0c6d7c854a9958512315ee30f03d5de14ea268b /numpy/ma/tests/test_extras.py
parentb2006cb2a7fe508bca8aa7039352731634869334 (diff)
downloadpython-numpy-36e7513edd1114c3f928be66953d4349273122c0.tar.gz
python-numpy-36e7513edd1114c3f928be66953d4349273122c0.tar.bz2
python-numpy-36e7513edd1114c3f928be66953d4349273122c0.zip
BUG: np.ma.mr_['r',...] does not return masked arrays
Diffstat (limited to 'numpy/ma/tests/test_extras.py')
-rw-r--r--numpy/ma/tests/test_extras.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_extras.py b/numpy/ma/tests/test_extras.py
index 7de21ff59..4b7fe07b6 100644
--- a/numpy/ma/tests/test_extras.py
+++ b/numpy/ma/tests/test_extras.py
@@ -308,6 +308,16 @@ class TestConcatenator(TestCase):
def test_matrix_builder(self):
assert_raises(np.ma.MAError, lambda: mr_['1, 2; 3, 4'])
+ def test_matrix(self):
+ actual = mr_['r', 1, 2, 3]
+ expected = np.ma.array(np.r_['r', 1, 2, 3])
+ assert_array_equal(actual, expected)
+
+ # outer type is masked array, inner type is matrix
+ assert_equal(type(actual), type(expected))
+ assert_equal(type(actual.data), type(expected.data))
+
+
class TestNotMasked(TestCase):
# Tests notmasked_edges and notmasked_contiguous.