historydag.counterops
Functions for manipulating collections.Counter
objects.
Functions
|
'multiply' two Counters. |
|
Sum a list of counters. |
- historydag.counterops.counter_prod(counterlist, accumfunc)[source]
‘multiply’ two Counters. Really a sort of cartesian product, which does accumfunc to keys and counts all the ways each result can be achieved using contents of counters in counterlist.
accumfunc must be a function like sum which acts on a list of arbitrary length. Probably should return an object of the same type.