diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-01-31 01:12:53 -0800 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-01-31 01:12:53 -0800 |
commit | f80e20cfcf0728e068933cd5de9575db8ac3f803 (patch) | |
tree | 1f9d2447bfd7c503e03d4afa936b1903d210287c /numpy/lib/arraysetops.py | |
parent | 41872c1085b707a6020b0058dc063d2981520bc6 (diff) | |
download | numpy-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.py | 4 |
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 |