Skip to content

Commit

Permalink
Merge pull request #1 from Ipuch/main
Browse files Browse the repository at this point in the history
  • Loading branch information
Ipuch authored Feb 2, 2024
2 parents 1b0cdf2 + fad563d commit 4152f2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions majority_judgment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ def majority_judgment(
votes_by_candidate: Dict[Candidate, List[Vote]]
Results of the votes
Candidate correspond to the names of candidates,
List of int is the votes for each candidates.
List of int is the votes for each candidate.
The higher the vote, the better.
reverse: bool
If true, a lower vote value indicates a better vote.
Returns
-------
Rank order for each candidates in a Dictionary Dict[Candidate, rank: int]
Rank order for each candidate in a Dictionary Dict[Candidate, rank: int]
>>> A = [3, 3, 3, 0,0,0, 1,1, 2,2]
>>> B = [0,0, 1,1,2,2,2,2,3,3]
>>> A = [3, 3, 3, 0, 0, 0, 1, 1, 2, 2]
>>> B = [0, 0, 1, 1, 2, 2, 2, 2, 3, 3]
>>> majority_judgment({'A': A, 'B': B}, reverse=False)
{'B': 0, 'A': 1}
>>> majority_judgment({'A': A, 'B': B}, reverse=True)
Expand Down

0 comments on commit 4152f2c

Please sign in to comment.