Assign ranks to the data in a, dealing with ties appropriately.
Equal values are assigned a rank that is the average of the ranks that would have been otherwise assigned to all of the values within that set. Ranks begin at 1.
Parameters : | a : array_like
|
---|---|
Returns : | ranks : ndarray
|
Notes
All floating point types are converted to numpy.float64 before ranking. This may result in spurious ties if an input array of floats has a wider data type than numpy.float64 (e.g. numpy.float128).
Examples
>>> rankdata([0, 2, 3, 2])
array([ 1. , 2.5, 4. , 2.5])