Closed
Description
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.