Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Address TODO for sort order in the output of unique() #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions spec/API_specification/set_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A conforming implementation of the array API standard must provide and support t
<!-- NOTE: please keep the functions in alphabetical order -->

(function-unique)=
### unique(x, /, *, return_counts=False, return_index=False, return_inverse=False, sorted=True)
### unique(x, /, *, return_counts=False, return_index=False, return_inverse=False)

Returns the unique elements of an input array `x`.

Expand All @@ -35,12 +35,6 @@ Returns the unique elements of an input array `x`.

- If `True`, the function must also return the indices of the unique array that reconstruct `x`. Default: `False`.

- **sorted**: _bool_

- If `True`, the function must sort the unique elements in ascending order before returning as output. If `False`, the function must sort the unique elements in the same order that they occur in `x`. Default: `False`.

_TODO: sort order needs discussion. See [gh-40](https://github.com/data-apis/array-api/issues/40)_

#### Returns

- **out**: _Union\[ &lt;array&gt;, Tuple\[ &lt;array&gt;, ... ] ]_
Expand All @@ -51,6 +45,10 @@ Returns the unique elements of an input array `x`.

- an array containing the set of unique elements in `x`. The returned array must have the same data type as `x`.

```{note}
The order of elements is not specified, and may vary between implementations.
```

- **indices**: _&lt;array&gt;_

- an array containing the indices (first occurrences) of `x` that result in `unique`. The returned array must have the default array index data type.
Expand Down