@@ -203,6 +203,7 @@ def unique(ar, return_index=False, return_inverse=False,
203
203
See Also
204
204
--------
205
205
repeat : Repeat elements of an array.
206
+ sort : Return a sorted copy of an array.
206
207
207
208
Notes
208
209
-----
@@ -216,17 +217,15 @@ def unique(ar, return_index=False, return_inverse=False,
216
217
flattened subarrays are sorted in lexicographic order starting with the
217
218
first element.
218
219
219
- .. versionchanged: 1.21
220
- If nan values are in the input array, a single nan is put
221
- to the end of the sorted unique values.
222
-
223
- Also for complex arrays all NaN values are considered equivalent
220
+ .. versionchanged:: 1.21
221
+ Like np.sort, NaN will sort to the end of the values.
222
+ For complex arrays all NaN values are considered equivalent
224
223
(no matter whether the NaN is in the real or imaginary part).
225
224
As the representant for the returned array the smallest one in the
226
225
lexicographical order is chosen - see np.sort for how the lexicographical
227
226
order is defined for complex arrays.
228
227
229
- .. versionchanged: 2.0
228
+ .. versionchanged:: 2.0
230
229
For multi-dimensional inputs, ``unique_inverse`` is reshaped
231
230
such that the input can be reconstructed using
232
231
``np.take(unique, unique_inverse, axis=axis)``. The result is
0 commit comments