dask 2021.10.0

ParametersBackRef
stack(seq, axis=0, allow_unknown_chunksizes=False)

Given a sequence of dask arrays, form a new dask array by stacking them along a new dimension (axis=0 by default)

Parameters

seq: list of dask.arrays :
axis: int :

Dimension along which to align all of the arrays

allow_unknown_chunksizes: bool :

Allow unknown chunksizes, such as come from converting from dask dataframes. Dask.array is unable to verify that chunks line up. If data comes from differently aligned sources then this can cause unexpected results.

Stack arrays along a new axis

See Also

concatenate

Examples

Create slices

This example is valid syntax, but we were not able to check execution
>>> import dask.array as da
... import numpy as np
This example is valid syntax, but we were not able to check execution
>>> data = [da.from_array(np.ones((4, 4)), chunks=(2, 2))
...  for i in range(3)]
This example is valid syntax, but we were not able to check execution
>>> x = da.stack(data, axis=0)
... x.shape (3, 4, 4)
This example is valid syntax, but we were not able to check execution
>>> da.stack(data, axis=1).shape
(4, 3, 4)
This example is valid syntax, but we were not able to check execution
>>> da.stack(data, axis=-1).shape
(4, 4, 3)

Result is a new dask Array

See :

Back References

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

dask.array.core.stack dask.utils.concatenate dask.array.core.concatenate dask.array.routines.dstack dask.array.routines.hstack dask.array.core.block dask.array.routines.vstack

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/core.py#4747
type: <class 'function'>
Commit: