summaryrefslogtreecommitdiff
path: root/numpy/lib/arraysetops.py
diff options
context:
space:
mode:
authorCJ Carey <perimosocordiae@gmail.com>2014-09-22 14:30:36 -0400
committerCJ Carey <perimosocordiae@gmail.com>2014-09-23 11:06:53 -0400
commit7efd5cf4cc6cd45f6114fdbc3fbfd619ddf03deb (patch)
tree69b5a584a51d5919526485784d14b5dc6d68266c /numpy/lib/arraysetops.py
parentc85e31e6331efe96034fe76c5a6b9d60698c0f23 (diff)
downloadnumpy-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.py2
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: