dask 2021.10.0

ParametersReturnsBackRef
indices(dimensions, dtype=<class 'int'>, chunks='auto')

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

dimensions : sequence of ints

The shape of the index grid.

dtype : dtype, optional

Type to use for the array. Default is int .

chunks : sequence 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

grid : dask array

Implements NumPy's indices for Dask Arrays.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

dask.blockwise._get_coord_mapping dask.blockwise._make_dims dask.array.routines.take dask.array.creation.fromfunction

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/array/creation.py#456
type: <class 'function'>
Commit: