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/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/arraysetops.py')
-rw-r--r-- | numpy/lib/arraysetops.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index bc80d0ecd..5c3b504de 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -204,7 +204,7 @@ def unique(ar, return_index=False, return_inverse=False, return_counts=False): ret += (perm[flag],) if return_inverse: iflag = np.cumsum(flag) - 1 - inv_idx = np.empty_like(ar, dtype=np.intp) + inv_idx = np.empty(ar.shape, dtype=np.intp) inv_idx[perm] = iflag ret += (inv_idx,) if return_counts: |