Skip to content

Latest commit

 

History

History
237 lines (151 loc) · 4.02 KB

api.rst

File metadata and controls

237 lines (151 loc) · 4.02 KB

API Reference

more_itertools

Grouping

These tools yield groups of items from a source iterable.


New itertools

chunked

sliced

distribute

divide

split_at

split_before

split_after

bucket


Itertools recipes

grouper

partition

Lookahead and lookback

These tools peek at an iterable's values without advancing it.


New itertools

spy

peekable

seekable

Windowing

These tools yield windows of items from an iterable.


New itertools

windowed

stagger


Itertools recipes

pairwise

Augmenting

These tools yield items from an iterable, plus additional data.


New itertools

count_cycle

intersperse

padded

adjacent

groupby_transform


Itertools recipes

padnone

ncycles

Combining

These tools combine multiple iterables.


New itertools

collapse

sort_together

interleave

interleave_longest

collate(*iterables, key=lambda a: a, reverse=False)

zip_offset(*iterables, offsets, longest=False, fillvalue=None)


Itertools recipes

dotproduct

flatten

roundrobin

prepend

Summarizing

These tools return summarized or aggregated data from an iterable.


New itertools

ilen

first(iterable[, default])

last(iterable[, default])

one

unique_to_each

locate(iterable, pred=bool, window_size=None)

rlocate(iterable, pred=bool, window_size=None)

consecutive_groups(iterable, ordering=lambda x: x)

exactly_n(iterable, n, predicate=bool)

run_length

map_reduce


Itertools recipes

all_equal

first_true

nth

quantify(iterable, pred=bool)

Selecting

These tools yield certain items from an iterable.


New itertools

islice_extended(start, stop, step)

strip

lstrip

rstrip


Itertools recipes

take

tail

unique_everseen

unique_justseen

Combinatorics

These tools yield combinatorial arrangements of items from iterables.


New itertools

distinct_permutations

circular_shifts


Itertools recipes

powerset

random_product

random_permutation

random_combination

random_combination_with_replacement

nth_combination

Wrapping

These tools provide wrappers to smooth working with objects that produce or consume iterables.


New itertools

always_iterable

consumer

with_iter


Itertools recipes

iter_except

Others

New itertools

replace

numeric_range(start, stop, step)

always_reversible

side_effect

iterate

difference(iterable, func=operator.sub)

make_decorator

SequenceView


Itertools recipes

consume

accumulate(iterable, func=operator.add)

tabulate

repeatfunc