endolith / endolith/elsim

Vectorize methods

Open
#1 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
8
Forks
4
Avg merge
8h 2m
Merged PRs (30d)
2

Description

I think all of these functions could accept 3D arrays of shape `(n_voters, n_cands, n_elections)` or `(n_elections, n_voters, n_cands)`, whichever makes more sense, and return a list of winners for each election.

```
np.array((impartial_culture(5, 4), impartial_culture(5, 4)))
Out[16]:
array([[[1, 2, 0, 3],
[2, 1, 3, 0],
[3, 0, 1, 2],
[3, 1, 2, 0],
[2, 3, 0, 1]],

[[0, 2, 3, 1],
[2, 3, 1, 0],
[1, 3, 2, 0],
[2, 1, 0, 3],
[0, 2, 3, 1]]], dtype=uint8)

_.shape
Out[17]: (2, 5, 4)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.