Skip to content

ENH: add 'dense' ranking method #6333

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

Closed
dsm054 opened this issue Feb 12, 2014 · 3 comments
Closed

ENH: add 'dense' ranking method #6333

dsm054 opened this issue Feb 12, 2014 · 3 comments
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Enhancement Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@dsm054
Copy link
Contributor

dsm054 commented Feb 12, 2014

scipy.stats.rankdata has five ranking methods: average, min, and max, equivalent to the same options in Series.rank; ordinal, corresponding to our first; but it also has dense:

    'dense':
        Like 'min', but the rank of the next highest element is assigned
        the rank immediately after those assigned to the tied elements.

For example,

>>> scipy.stats.rankdata([3,1,2,1,3], "min")
array([ 4.,  1.,  3.,  1.,  4.])
>>> scipy.stats.rankdata([3,1,2,1,3], "dense")
array([ 3.,  1.,  2.,  1.,  3.])

I've wanted this in the past, and it just showed up on SO.

@jreback
Copy link
Contributor

jreback commented Feb 16, 2014

FYI, just merged this : #5978

I don't think it affects what you are doing..but be on the look out

@dan-blanchard
Copy link

👍

@jreback
Copy link
Contributor

jreback commented Mar 1, 2014

closed by #6514

@jreback jreback closed this as completed Mar 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Enhancement Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants