cf.Data.chunk_indices

Data.chunk_indices()[source]

Return indices that define each dask compute chunk.

New in version 3.15.0.

See also

chunks

Returns
itertools.product

An iterator over tuples of indices of the data array.

Examples

>>> d = cf.Data(np.arange(405).reshape(3, 9, 15),
...             chunks=((1, 2), (9,), (4, 5, 6)))
>>> d.npartitions
6
>>> for index in d.chunk_indices():
...     print(index)
...
(slice(0, 1, None), slice(0, 9, None), slice(0, 4, None))
(slice(0, 1, None), slice(0, 9, None), slice(4, 9, None))
(slice(0, 1, None), slice(0, 9, None), slice(9, 15, None))
(slice(1, 3, None), slice(0, 9, None), slice(0, 4, None))
(slice(1, 3, None), slice(0, 9, None), slice(4, 9, None))
(slice(1, 3, None), slice(0, 9, None), slice(9, 15, None))