Sequentially Spent Score: Difference between revisions
→Python Implementation: update code
Dr. Edmonds (talk | contribs) (→Variants: add sorted surplus handling variant) |
Dr. Edmonds (talk | contribs) (→Python Implementation: update code) |
||
Line 41:
#Find number of voters
V =
quota = V/W
ballot_weight = pd.Series(np.ones(V),name='weights')
#Populate winners in a loop
Line 47 ⟶ 49:
while len(winner_list) < W:
#remove winner from ballot
▲ #Total score left to be spent by each voter
ballots.drop(w, axis=1, inplace=True)
▲ ballot_weight = np.clip(ballot_weight-score_spent,0.0,1.0)
</source>
|