dask.array.indices

dask.array.indices

dask.array.indices(dimensions, dtype=<class 'int'>, chunks='auto')[source]

Implements NumPy’s indices for Dask Arrays.

Generates a grid of indices covering the dimensions provided.

The final array has the shape (len(dimensions), *dimensions). The chunks are used to specify the chunking for axis 1 up to len(dimensions). The 0th axis always has chunks of length 1.

Parameters
dimensionssequence of ints

The shape of the index grid.

dtypedtype, optional

Type to use for the array. Default is int.

chunkssequence of ints, str

The size of each block. Must be one of the following forms:

  • A blocksize like (500, 1000)

  • A size in bytes, like “100 MiB” which will choose a uniform block-like shape

  • The word “auto” which acts like the above, but uses a configuration value array.chunk-size for the chunk size

Note that the last block will have fewer samples if len(array) % chunks != 0.

Returns
griddask array