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 Distribution

ranking-0.2.2.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file ranking-0.2.2.tar.gz.

File metadata

  • Download URL: ranking-0.2.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ranking-0.2.2.tar.gz
Algorithm Hash digest
SHA256 58d98471da61b7de6082c90830738286587067a95cb8a9c27ffba2256ac79f10
MD5 d9041c2f037716cd0d0f8818f17acf6c
BLAKE2b-256 5ea241041abc5ad87a275ba5abb5760bf73a988e2940e693255171d3f315a270

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