summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2019-09-12 16:22:37 -0700
committerGitHub <noreply@github.com>2019-09-12 16:22:37 -0700
commite97975a2027e81d93ccdc96ab767653773b3cc04 (patch)
tree4bf9c25fb09f9c690c56bae88e176efe3b15f696 /numpy/lib/tests
parent9722d1b682a7596c9aa5f4fa0279f26702bb4ff6 (diff)
parent17fe313d3cd4b73be3050409b314f545637bcf81 (diff)
downloadnumpy-e97975a2027e81d93ccdc96ab767653773b3cc04.tar.gz
Merge pull request #14255 from hgt312/fix_unique
BUG: fix inconsistent axes ordering for axis in function `unique`
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_arraysetops.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
index dd8a38248..fd21a7f76 100644
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -600,8 +600,11 @@ class TestUnique(object):
assert_array_equal(unique(data, axis=1), result.astype(dtype), msg)
msg = 'Unique with 3d array and axis=2 failed'
- data3d = np.dstack([data] * 3)
- result = data3d[..., :1]
+ data3d = np.array([[[1, 1],
+ [1, 0]],
+ [[0, 1],
+ [0, 0]]]).astype(dtype)
+ result = np.take(data3d, [1, 0], axis=2)
assert_array_equal(unique(data3d, axis=2), result, msg)
uniq, idx, inv, cnt = unique(data, axis=0, return_index=True,