Skip to content
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

Rank has incorrect output for equivalent values #884

Closed
viceroypenguin opened this issue Nov 14, 2022 · 1 comment
Closed

Rank has incorrect output for equivalent values #884

viceroypenguin opened this issue Nov 14, 2022 · 1 comment

Comments

@viceroypenguin
Copy link
Contributor

Given the following sequence: new[] { 2, 2, 1, 1, 3, 3, }

Currently Rank produces the following sequence: { 3, 4, 1, 2, 5, 6, }.

However, equivalent values should have equivalent ranks. Any desire to have differentiate between values should be done as part of the input sequence and/or the comparer.

The proper result for Rank should be: { 3, 3, 1, 1, 5, 5, }. If gaps are not desired, then DenseRank may be added which would return: { 2, 2, 1, 1, 3, 3, }.

CC: @AmbientLion

@viceroypenguin
Copy link
Contributor Author

Duplicate of #826

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant