Open jontingvold opened 4 years ago
Thanks. Good to know. Then I will definitely try to optimize it with Numpy/Pandas some time.
Counterpoint though, it is kind of nice to have a pure python library. What sort of workloads were you expecting? For my algo, my intuition was that having 2 voters with votes for 500 candidates & the rest with votes for 1 or 2 candidates was just a bad idea, (the 500th candidate on a ballot isn't going to win anyhow) & performance was better truncating the 2 voters' ballots with too many candidates on their ballots. Here is my code if you're curious: https://github.com/matthewdeanmartin/whats_that_code/blob/main/whats_that_code/election.py
I can report that the code is noticeably slow with 100s of candidates. I just reduced the number of candidates & ran at an acceptable speed again.