summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-01-18 18:09:25 -0700
committerGitHub <noreply@github.com>2018-01-18 18:09:25 -0700
commit7d2c9d1b32a2d76d28453705e6f8b589d7e273d7 (patch)
tree55f0d8875ba0695860069705d49d03cd810082d7 /numpy/lib/tests
parent8a772dd80929aa556c6c01b9025f3c1da0666938 (diff)
parent70e34252dc224ace1192cb8534fd55442afe3dfe (diff)
downloadnumpy-7d2c9d1b32a2d76d28453705e6f8b589d7e273d7.tar.gz
Merge pull request #10342 from anaskhan96/union1d-fix
BUG: arrays not being flattened in `union1d`
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_arraysetops.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
index b4787838d..c2ba7ac86 100644
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -247,6 +247,14 @@ class TestSetOps(object):
c = union1d(a, b)
assert_array_equal(c, ec)
+ # Tests gh-10340, arguments to union1d should be
+ # flattened if they are not already 1D
+ x = np.array([[0, 1, 2], [3, 4, 5]])
+ y = np.array([0, 1, 2, 3, 4])
+ ez = np.array([0, 1, 2, 3, 4, 5])
+ z = union1d(x, y)
+ assert_array_equal(z, ez)
+
assert_array_equal([], union1d([], []))
def test_setdiff1d(self):