summaryrefslogtreecommitdiff
path: root/numpy/lib/arraysetops.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-01-31 01:12:53 -0800
committerEric Wieser <wieser.eric@gmail.com>2018-01-31 01:12:53 -0800
commitf80e20cfcf0728e068933cd5de9575db8ac3f803 (patch)
tree1f9d2447bfd7c503e03d4afa936b1903d210287c /numpy/lib/arraysetops.py
parent41872c1085b707a6020b0058dc063d2981520bc6 (diff)
downloadnumpy-f80e20cfcf0728e068933cd5de9575db8ac3f803.tar.gz
MAINT: Make it clear that counts and inverse depend only on the mask
Diffstat (limited to 'numpy/lib/arraysetops.py')
-rw-r--r--numpy/lib/arraysetops.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
index 1ac1f3f03..e6ff5bf38 100644
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -284,11 +284,11 @@ def _unique1d(ar, return_index=False, return_inverse=False,
ret += (perm[mask],)
if return_inverse:
imask = np.cumsum(mask) - 1
- inv_idx = np.empty(ar.shape, dtype=np.intp)
+ inv_idx = np.empty(mask.shape, dtype=np.intp)
inv_idx[perm] = imask
ret += (inv_idx,)
if return_counts:
- idx = np.concatenate(np.nonzero(mask) + ([ar.size],))
+ idx = np.concatenate(np.nonzero(mask) + ([mask.size],))
ret += (np.diff(idx),)
return ret