summaryrefslogtreecommitdiff
path: root/numpy/lib/arraysetops.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/arraysetops.py')
-rw-r--r--numpy/lib/arraysetops.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
index 0755fffd1..005703d16 100644
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -167,13 +167,7 @@ def unique(ar, return_index=False, return_inverse=False, return_counts=False):
array([1, 2, 6, 4, 2, 3, 2])
"""
- try:
- ar = ar.flatten()
- except AttributeError:
- if not return_inverse and not return_index and not return_counts:
- return np.sort(list((set(ar))))
- else:
- ar = np.asanyarray(ar).flatten()
+ ar = np.asanyarray(ar).flatten()
optional_indices = return_index or return_inverse
optional_returns = optional_indices or return_counts