|
@@ -24,8 +24,8 @@ def majority_choice(values):
|
|
|
counts = values.value_counts(sort = True)
|
|
|
counts = counts[counts == counts[0]]
|
|
|
|
|
|
- # return the majority choice if it exists
|
|
|
- # otherwise, do a random pick
|
|
|
+ # return the majority choice if it is unambiguous
|
|
|
+ # otherwise, pick randomly among the candidates
|
|
|
if len(counts) <= 1:
|
|
|
return counts.index[0]
|
|
|
else:
|