summaryrefslogtreecommitdiff
path: root/numpy/lib/arraysetops.py
diff options
context:
space:
mode:
authorjaimefrio <jaime.frio@gmail.com>2014-02-21 16:35:32 -0800
committerjaimefrio <jaime.frio@gmail.com>2014-02-21 16:38:00 -0800
commita712c675d15385dc1cc3953a93423223d58d368d (patch)
treea2984802d73d443a7e2df36273329119141139ee /numpy/lib/arraysetops.py
parentdd857489fcaa745ea569c523249fe37537bfe280 (diff)
downloadnumpy-a712c675d15385dc1cc3953a93423223d58d368d.tar.gz
BUG: Fixes #2799
Use `np.sort` instead of `sorted` when the input is a list and no indices are requested. Fixes #2799.
Diffstat (limited to 'numpy/lib/arraysetops.py')
-rw-r--r--numpy/lib/arraysetops.py3
1 files changed, 1 insertions, 2 deletions
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()