From f80e20cfcf0728e068933cd5de9575db8ac3f803 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Wed, 31 Jan 2018 01:12:53 -0800 Subject: MAINT: Make it clear that counts and inverse depend only on the mask --- numpy/lib/arraysetops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/lib/arraysetops.py') 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 -- cgit v1.2.1