itertools 1.1.0
Additional range primitives for iteration
To use this package, run the following command in your project's root directory:
itertools
Additional range primitives for iterations. (inspired by Python)
Methods
pairwise
Iterates over a range in pairs.
Allows nonfilling end intervals:
[1,2,3].pairwise().array == [[1,2],[2,3]]
Params:
r = Range from which the minimum will be selected
pairLength = Pair size (default 2)
Returns: The minimum of the passedin values.
product
Lazily computes the Cartesian product of $(D r).
If the input is sorted, the product is in lexicographic order.
For example $(D"AB".product(2).array) returns $(D["AA", "AB", "BA", "BB"])
Params:
r = RandomAccessRange or string as origin
repeat = number of repetitions
Returns:
Forward range with includes
combinations
Lazily computes the all kcombinations of $(D r).
Imagine this as the product filtered for only strictly ordered items.
For example $(D"AB".combinations(2).array) returns $(D["AB"]).
Params:
r = RandomAccessRange or string as origin
k = number of combinations
Returns:
Forward range which yields the kcombinations items
combinationsRepeat
Lazily computes the all kcombinations of $(D r) with repetitions.
A kcombination with repetitions, or kmulticombination, or multisubset of size k from a set S is given by a sequence of k not necessarily distinct elements of S, where order is not taken into account.
Imagine this as the product filtered for only ordered items.
For example $(D"AB".combinationsRepeat(2).array) returns $(D["AA", "AB", "BB"]).
Params:
r = RandomAccessRange or string as origin
k = number of combinations
Returns:
Forward range which yields the kmulticombinations items
TODO
 add
save
to product
 1.1.0 released 4 years ago
 greenify/ditertools
 MIT
 Copyright © 2016, greenify
 Authors:
 Dependencies:
 none
 Versions:

1.1.0 2016Feb27 1.0.0 2016Feb26 ~master 2016May03  Download Stats:


0 downloads today

0 downloads this week

0 downloads this month

0 downloads total

 Score:
 0.4
 Short URL:
 itertools.dub.pm