diff options
author | CJ Carey <perimosocordiae@gmail.com> | 2014-09-22 14:30:36 -0400 |
---|---|---|
committer | CJ Carey <perimosocordiae@gmail.com> | 2014-09-23 11:06:53 -0400 |
commit | 7efd5cf4cc6cd45f6114fdbc3fbfd619ddf03deb (patch) | |
tree | 69b5a584a51d5919526485784d14b5dc6d68266c /numpy/lib/tests/test_arraysetops.py | |
parent | c85e31e6331efe96034fe76c5a6b9d60698c0f23 (diff) | |
download | numpy-7efd5cf4cc6cd45f6114fdbc3fbfd619ddf03deb.tar.gz |
BUG: np.unique with chararray + inverse_index
The call to `empty_like` was trying to use the `chararray` subclass,
which doesn't support the `np.intp` dtype.
Diffstat (limited to 'numpy/lib/tests/test_arraysetops.py')
-rw-r--r-- | numpy/lib/tests/test_arraysetops.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py index e83f8552e..39196f4bc 100644 --- a/numpy/lib/tests/test_arraysetops.py +++ b/numpy/lib/tests/test_arraysetops.py @@ -109,6 +109,12 @@ class TestSetOps(TestCase): assert_array_equal(a2, unq) assert_array_equal(a2_inv, inv) + # test for chararrays with return_inverse (gh-5099) + a = np.chararray(5) + a[...] = '' + a2, a2_inv = np.unique(a, return_inverse=True) + assert_array_equal(a2_inv, np.zeros(5)) + def test_intersect1d(self): # unique inputs a = np.array([5, 7, 1, 2]) |