Group: http://groups.google.com/group/pymntos/topics
William Cannon <william...@gmail.com> Nov 17 08:46PM -0600
*Challenge (albeit a bit late) Accepted!*
I wrote up a ranked choice voting calculator in python today.
https://github.com/wcannon/ranked-choice-voting.git
*Programs:*
*election.py*
provides: ranked-choice voting
input: csv file containing all votes for an election (1 vote per line, a
line consists of 1+ choices for a candidate)
output: run it and see
e.g. election.py election_csv_file.csv
*election_votes_generator.py*
provides: a simple way to create a csv of ranked-choice votes
input: arguments (OUTPUT_FILE VOTERS CANDIDATES ALLOWED_CHOICES)
e.g. election_votes_generator.py out.csv 200000 15 3
This would create a simulated set of votes containing 200000 votes, with 15
candidates, where a vote is for 3 candidates in ranked order.
fyi: I ran a simulated election with 1000000 votes, 30 candidates, and 3
choices allowed per vote.
Time to run… 1 minute 31 seconds.
If this is interesting to anyone, please use it and contribute back.
Warm regards,
William Cannon
Peter Farrell <p...@maestropublishing.com> Nov 18 06:35PM -0600
--
Bill, this looks really cool. I checked out the source for it and it isn't
that complicated at all.
A couple of questions:
1) Is that the real .csv ballot information from the 2013 MPLS Mayor's race?
2) If yes, did you're output match the number of rounds and results from
the race?
3) Would you like to present this at PyMNtos meeting sometime in the future?
Meetings Schedule / RVSP on our Meetup at http://python.mn
---
You received this message because you are subscribed to the Google Groups "PyMNtos" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pymntos+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.