diff options
author | Dima Kogan <dima@secretsauce.net> | 2020-08-05 10:33:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-05 10:33:42 -0700 |
commit | 6bed9a91c1be207d2b69f13355449347d22c850b (patch) | |
tree | b0d518bbe0a257927883aedbe4500fde3004b101 /numpy/lib | |
parent | e1211b83062881d34790f45bd666a62cf00292a3 (diff) | |
download | numpy-6bed9a91c1be207d2b69f13355449347d22c850b.tar.gz |
DOC: Improve intersect1d docstring (#16420)
The docstring now says what to expect if you call
intersect1d(assume_unique=True) but pass in non-unique data.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/arraysetops.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index 6cca1738b..df9a110c5 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -369,7 +369,9 @@ def intersect1d(ar1, ar2, assume_unique=False, return_indices=False): Input arrays. Will be flattened if not already 1D. assume_unique : bool If True, the input arrays are both assumed to be unique, which - can speed up the calculation. Default is False. + can speed up the calculation. If True but ``ar1`` or ``ar2`` are not + unique, incorrect results and out-of-bounds indices could result. + Default is False. return_indices : bool If True, the indices which correspond to the intersection of the two arrays are returned. The first instance of a value is used if there are |