From a712c675d15385dc1cc3953a93423223d58d368d Mon Sep 17 00:00:00 2001 From: jaimefrio Date: Fri, 21 Feb 2014 16:35:32 -0800 Subject: BUG: Fixes #2799 Use `np.sort` instead of `sorted` when the input is a list and no indices are requested. Fixes #2799. --- numpy/lib/arraysetops.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'numpy/lib/arraysetops.py') diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index 5cd535703..691550579 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -163,8 +163,7 @@ def unique(ar, return_index=False, return_inverse=False): ar = ar.flatten() except AttributeError: if not return_inverse and not return_index: - items = sorted(set(ar)) - return np.asarray(items) + return np.sort(list(set(ar))) else: ar = np.asanyarray(ar).flatten() -- cgit v1.2.1