kopia lustrzana https://github.com/martinlackner/apportionment
merge
rodzic
a461253a78
commit
b70224dc1d
|
@ -43,7 +43,7 @@ D'Hondt (Jefferson) method
|
|||
which is indeed the [official result](https://www.bmi.gv.at/412/Europawahlen/Europawahl_2019).
|
||||
|
||||
Another example can be found in [examples/example.py](examples/example.py).
|
||||
An example with the Austrian National Council elections can be found in [examples/austria_example.py](examples/austria_example.py)
|
||||
An example with the Austrian National Council elections can be found in [examples/austria_examples.py](examples/austria_examples.py)
|
||||
|
||||
## References
|
||||
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
from __future__ import print_function
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
import apportionment
|
||||
|
||||
with open("./nr_wahlen.txt", "r") as f:
|
||||
|
||||
for line in f:
|
||||
result = eval(line)
|
||||
print(result[0])
|
||||
print(apportionment.method("dhondt", result[2],
|
||||
sum(result[3]),
|
||||
parties=result[1],
|
||||
threshold=.04,
|
||||
verbose=False))
|
||||
# actual results
|
||||
print(result[3])
|
|
@ -0,0 +1,19 @@
|
|||
from __future__ import print_function
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
import apportionment
|
||||
|
||||
with open("./nr_wahlen.txt", "r") as f:
|
||||
|
||||
for line in f:
|
||||
year, partynames, votes, officialresult = eval(line)
|
||||
print(year)
|
||||
result = apportionment.method("dhondt", votes,
|
||||
183,
|
||||
parties=partynames,
|
||||
threshold=.04,
|
||||
verbose=True)
|
||||
# actual results
|
||||
print("Identical with official result: "
|
||||
+ (str(tuple(result) == tuple(officialresult)))
|
||||
+ "\n\n")
|
Ładowanie…
Reference in New Issue