From 6bed9a91c1be207d2b69f13355449347d22c850b Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Wed, 5 Aug 2020 10:33:42 -0700 Subject: 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 --- numpy/lib/arraysetops.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'numpy/lib/arraysetops.py') 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 -- cgit v1.2.1