iterlib: More itertools¶
More itertools
Functions¶
|
Return the average of seq, or empty if the seq. |
|
iterate over seq[:-1] |
|
iterate over seq[:-n] |
|
Break iterable into lists of length n: |
|
Returns a generator of tuples (offset, chunksize) |
|
Split s according to keyfunc |
|
Advance the iterator n-steps ahead. |
|
Returns the dot product (the sum of the product between each pair) between vec1 and vec2 |
|
return an iterator over seq with n elements consumed |
|
Find duplicates in the iterable s |
|
|
|
Given a dictionary, return a flat list where keys and values are interleaved. |
|
Return an iterator to the flattened items of sequence s |
|
Like flatten, but returns a list instead of an iterator |
|
Flatten only if subsequences are of type 'type' |
|
Consume an iterable not reading it into memory; return the number of items. |
|
Intercalate item between elements of seq |
|
Interleave a sequence of sequences |
|
Returns True if obj is iterable |
|
Returns an iterator over chunks of seq of at most chunksize size. |
|
Returns the last element of seq or None if seq is empty |
|
iterator over the lexicographical pairs |
|
the same as mesh, but over 3 iterators |
|
Returns the sequence elements n times |
|
Returns the nth item |
|
Returns the elements in seq and then return element indefinitely. |
|
Similar to window(seq, size=2, step=1) |
|
Given arguments as passed to range, resolved them in (start, stop, step) |
|
Return the partial average in seq |
|
return the accumulated multiplication |
|
Return an iterator of the partial values of the reduce operation. |
|
for each elem in seq return the partial sum |
|
Random selection from itertools.combinations(iterable, r) |
|
Random selection from itertools.permutations(iterable, r) |
|
Repeat calls to func with specified arguments. |
The same as enumerate but reverses the sequence |
|
|
returns the first n elements of seq as a list |
|
Return only unique elements of a sequence (keeps order) |
|
iterate over subseqs of iterable |
|
A sliding window over subseqs of seq |
|
like izip but flat. |
Classes¶
|
Simple accumulator |