iterators#

Replacements for parts of the toolz library.

Functions#

groupby_to_dict(→ dict[K, list[T]])

A toolz-style groupby implementation.

unique(→ collections.abc.Iterable[T])

A toolz inspired unique implementation.

Attributes#

T

T#
groupby_to_dict(keyfunc: collections.abc.Callable[[T], K], iterable: collections.abc.Iterable[T]) dict[K, list[T]]#

A toolz-style groupby implementation.

Returns a dictionary of { key: [group] } instead of iterators.

unique(iterable: collections.abc.Iterable[T]) collections.abc.Iterable[T]#

A toolz inspired unique implementation.

Returns a generator of unique elements in the sequence