Skip to main content

Ranking collection

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

ranking-0.3.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file ranking-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: ranking-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.1

File hashes

Hashes for ranking-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e46dd802e6eb0af5ce34d8c12bccfaf22bed67475cbe6e21bc2be7ae0ebc199c
MD5 1bf882ba3ab28c23db1eede5f903e4ff
BLAKE2b-256 03f206f55d2808550b376e445f071d5e7375e2f1922be3f62194c6fad6f13bef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page