diff options
author | Huang, Guangtai <guangtai@amazon.com> | 2019-08-12 12:34:01 +0800 |
---|---|---|
committer | Huang, Guangtai <guangtai@amazon.com> | 2019-08-13 11:43:20 +0800 |
commit | 3b3eaa60dc31677d1b19cb49e5c414d41ac4089a (patch) | |
tree | 65df45e7f76fa9bdae959cae8343fea8deb8fbd8 /numpy/lib/tests/test_arraysetops.py | |
parent | cff02456fed4113924feef1d561e5e927aa2d86b (diff) | |
download | numpy-3b3eaa60dc31677d1b19cb49e5c414d41ac4089a.tar.gz |
fix unique
Diffstat (limited to 'numpy/lib/tests/test_arraysetops.py')
-rw-r--r-- | numpy/lib/tests/test_arraysetops.py | 7 |
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, |