semvec/pypi-packages huggingface dataset:
ranking 0.3.2
Ranking collection
License: BSD


Ranking
~~~~~~~

This library provides ``Ranking`` iterator to assign rank to each values and
various `strategies for assigning rankings`_.

>>> sorted_scores = [100, 90, 90, 80, 70]
>>> for rank, score in Ranking(sorted_scores):
...     print '%d. %d' % (rank + 1, score)
1. 100
2. 90
2. 90
4. 80
5. 70
>>> for rank, score in Ranking(sorted_scores, DENSE):
...     print '%d. %d' % (rank + 1, score)
1. 100
2. 90
2. 90
3. 80
4. 70

Links
`````

* `GitHub repository <http://github.com/sublee/ranking>`_
* `development version
  <http://github.com/sublee/ranking/zipball/master#egg=ranking-dev>`_

.. _strategies for assigning rankings: 
   http://en.wikipedia.org/wiki/Ranking#Strategies_for_assigning_rankings