Skip to content

Chunking

chunker(chunk_size, n_data, elements=None)

Provides slice for chunking data from the first dimension.

PARAMETER DESCRIPTION

chunk_size

The number of data to include in each chunk. If the total number of data is not evenly divisible by chunk_size, the final chunk will contain the remaining data.

TYPE: int

n_data

Total number of data in the first dimension.

TYPE: int

elements

Specific elements to chunk and yield. If None, then all are elements are chunked. If provided, elements are yielded in the order they appear in the input iterable, without de-duplication or sorting.

TYPE: Iterable[int] | int | None DEFAULT: None

YIELDS DESCRIPTION
Any

Each yielded value is a subset of data containing up to chunk_size elements.