> Every page of the ganymede website is listed in https://eugo.io/docs/ganymede/llms.txt.

# More Itertools

> More Itertools: Additional building blocks, recipes, and routines for working with Python iterables.

Web page: https://eugo.io/docs/ganymede/demo_notebooks/utilities/more_itertools/
Notebook: https://eugo.io/docs/ganymede/demo_notebooks/utilities/more_itertools/more_itertools.ipynb (source: https://github.com/eugo-inc/ganymede/blob/main/demo_notebooks/utilities/more_itertools.ipynb)

Description:
- Additional building blocks, recipes, and routines for working with Python iterables.

Resources:
- [GitHub] https://github.com/more-itertools/more-itertools/tree/v10.1.0
- [Recipes] https://docs.python.org/3/library/itertools.html#itertools-recipes
- [Docs] https://more-itertools.readthedocs.io/en/stable/api.html

## Example 1

Flatten a list of tuples

```python
from more_itertools import flatten

iterable = [(0, 1), (2, 3)]
list(flatten(iterable))
```

## Example 2

Chunk a list into a list of lists

```python
from more_itertools import chunked

iterable = [0, 1, 2, 3, 4, 5, 6, 7, 8]
list(chunked(iterable, 3))
```

## Example 3

“Look ahead” at items in the iterable without advancing it

```python
from more_itertools import spy

iterable = (x * x for x in range(1, 6))
head, iterable = spy(iterable, n=3)
list(head)

list(iterable)
```
