Last active
April 9, 2019 07:24
-
-
Save cmutel/da31024c68539cb23582a16b99faf6e3 to your computer and use it in GitHub Desktop.
BONSAI voting on nomenclature for "flow object" possible replacement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orig_data = """BDACFE | |
DCAFBE | |
AFDCEB | |
ADCFBE | |
CAEBDF | |
DCABFGHE | |
AFCED | |
DCAFBEGH | |
BGEACDH""".split("\n") | |
LETTERS = "ABCDEFGH" | |
def _(x, s, default): | |
try: | |
return s.index(x) + 1 | |
except ValueError: | |
return default + 1 | |
mapping = {x: i + 1 for i, x in enumerate(LETTERS)} | |
data = [[_(letter, line, len(LETTERS)) for letter in LETTERS] for line in orig_data] | |
for line in data: | |
print(str(line)[1:-1]) | |
import numpy as np | |
for letter in LETTERS: | |
print(letter, np.average([_(letter, line, len(LETTERS)) for line in orig_data])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To do instant runoff voting, use https://petertheone.github.io/IRV/
Use this list of candidates:
A
B
C
D
E
F
And these responses printed out by this gist.