From c25ffec7b8ed49d251515b22c2f257b2a091de16 Mon Sep 17 00:00:00 2001 From: endolith Date: Sun, 4 Jun 2023 14:54:34 -0400 Subject: [PATCH] Print summed scores with higher precision --- starpy/Allocated_Score.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/starpy/Allocated_Score.py b/starpy/Allocated_Score.py index 87d859e..6ca7a2b 100644 --- a/starpy/Allocated_Score.py +++ b/starpy/Allocated_Score.py @@ -18,8 +18,10 @@ def Allocated_Score(K, W, S): weighted_scores = ballots.multiply(ballot_weight, axis="index") #Select winner - w = weighted_scores.sum().idxmax() - #print('winner',w) + weighted_sums = weighted_scores.sum() + #print(f'\nWeighted scores:\n{weighted_sums.map("{:.20f}".format)}') + w = weighted_sums.idxmax() + #print(f'\nWinner: {w}') #Add winner to list winner_list.append(w)