summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-03-22 22:54:15 +0000
committerEric Wieser <wieser.eric@gmail.com>2017-05-05 21:43:39 +0100
commit0a4f3a050eca50b3ba9f5923656b052393babda4 (patch)
treed0981c7cc517cc9cbab24f1c966d0547d9950590 /numpy/lib
parent15e49b4e59ca20e706dbe8339345a35bd625857b (diff)
downloadpython-numpy-0a4f3a050eca50b3ba9f5923656b052393babda4.tar.gz
python-numpy-0a4f3a050eca50b3ba9f5923656b052393babda4.tar.bz2
python-numpy-0a4f3a050eca50b3ba9f5923656b052393babda4.zip
TST: Add some tests for passing r and c to r_
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/tests/test_index_tricks.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py
index 434dd14b4..67ff0e5d5 100644
--- a/numpy/lib/tests/test_index_tricks.py
+++ b/numpy/lib/tests/test_index_tricks.py
@@ -174,6 +174,19 @@ class TestConcatenator(TestCase):
assert_array_equal(d[:5, :], b)
assert_array_equal(d[5:, :], c)
+ def test_matrix(self):
+ a = [1, 2]
+ b = [3, 4]
+
+ ab_r = np.r_['r', a, b]
+ ab_c = np.r_['c', a, b]
+
+ assert_equal(type(ab_r), np.matrix)
+ assert_equal(type(ab_c), np.matrix)
+
+ assert_equal(np.array(ab_r), [[1,2,3,4]])
+ assert_equal(np.array(ab_c), [[1],[2],[3],[4]])
+
def test_matrix_builder(self):
a = np.array([1])
b = np.array([2])