chunk_iterable¶
- lsst.utils.iteration.chunk_iterable(data: Iterable[Any], chunk_size: int = 1000) Iterator[tuple[Any, ...]] ¶
Return smaller chunks of an iterable.
- Parameters:
- dataiterable of anything
The iterable to be chunked. Can be a mapping, in which case the keys are returned in chunks.
- chunk_sizeint, optional
The largest chunk to return. Can be smaller and depends on the number of elements in the iterator. Defaults to 1_000.
- Yields: