From 2ddba2a474a673131c67d011cfcb76a47b869072 Mon Sep 17 00:00:00 2001 From: Tyler Reddy Date: Fri, 12 Oct 2018 07:30:05 -0700 Subject: DOC, TST: test setdiff1d assume_unique * add unit test for setdiff1d covering code path where assume_unique is True * remove setdiff1d docstring guarantee that returned value is sorted -- it is not --- numpy/lib/arraysetops.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'numpy/lib/arraysetops.py') diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index 2f8c07114..ec62cd7a6 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -738,7 +738,7 @@ def setdiff1d(ar1, ar2, assume_unique=False): """ Find the set difference of two arrays. - Return the sorted, unique values in `ar1` that are not in `ar2`. + Return the unique values in `ar1` that are not in `ar2`. Parameters ---------- @@ -753,7 +753,9 @@ def setdiff1d(ar1, ar2, assume_unique=False): Returns ------- setdiff1d : ndarray - Sorted 1D array of values in `ar1` that are not in `ar2`. + 1D array of values in `ar1` that are not in `ar2`. The result + is sorted when `assume_unique=False`, but otherwise only sorted + if the input is sorted. See Also -------- -- cgit v1.2.1