Skip to content

Require that NaNs be considered distinct when returning unique elements #310

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 2 commits into from
Nov 4, 2021

Conversation

kgryte
Copy link
Contributor

@kgryte kgryte commented Nov 4, 2021

This PR

  • resolves Specify NaN behaviour in unique() #249 by requiring uniqueness be determined based on value equality (==).
  • requires that NaN values be considered distinct when returning the unique elements of an array. Accordingly, if an array contains multiple NaN values, the returned array will also contain multiple NaN values.
  • specifies that signed zeros be treated as equal. As a consequence, reconstructing an array containing signed zeros is not guaranteed to return the exact same array. Treating signed zeros as equal is the current prevailing behavior among array libraries (NumPy, MXNet, TF, ...).

@kgryte kgryte added the Maintenance Bug fix, typo fix, or general maintenance. label Nov 4, 2021
@kgryte kgryte added this to the v2021 milestone Nov 4, 2021
@kgryte
Copy link
Contributor Author

kgryte commented Nov 4, 2021

The changes introduced in this PR were discussed and approved during the consortium meeting held on 21 October 2021. Will merge. Any further changes can be addressed in follow-up PRs.

@kgryte kgryte merged commit e3e1a46 into main Nov 4, 2021
@kgryte kgryte deleted the nan-unique branch November 4, 2021 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Bug fix, typo fix, or general maintenance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify NaN behaviour in unique()
1 participant