dask 2021.10.0

ParametersReturnsBackRef
store(sources: 'Array | Collection[Array]', targets, lock: 'bool | Lock' = True, regions: 'tuple[slice, ...] | Collection[tuple[slice, ...]] | None' = None, compute: 'bool' = True, return_stored: 'bool' = False, **kwargs)

This stores dask arrays into object that supports numpy-style setitem indexing. It stores values chunk by chunk so that it does not have to fill up memory. For best performance you can align the block size of the storage target with the block size of your array.

If your data fits in memory then you may prefer calling np.array(myarray) instead.

Parameters

sources: Array or collection of Arrays :
targets: array-like or Delayed or collection of array-likes and/or Delayeds :

These should support setitem syntax target[10:20] = ...

lock: boolean or threading.Lock, optional :

Whether or not to lock the data stores while storing. Pass True (lock each file individually), False (don't lock) or a particular threading.Lock object to be shared among all writes.

regions: tuple of slices or collection of tuples of slices :

Each region tuple in regions should be such that target[region].shape = source.shape for the corresponding source and target in sources and targets, respectively. If this is a tuple, the contents will be assumed to be slices, so do not provide a tuple of tuples.

compute: boolean, optional :

If true compute immediately; return dask.delayed.Delayed otherwise.

return_stored: boolean, optional :

Optionally return the stored result (default False).

kwargs: :

Parameters passed to compute/persist (only used if compute=True)

Returns

If return_stored=True

tuple of Arrays

If return_stored=False and compute=True

None

If return_stored=False and compute=False

Delayed

Store dask arrays in array-like objects, overwrite data in target

Examples

This example is valid syntax, but we were not able to check execution
>>> import h5py  # doctest: +SKIP
... f = h5py.File('myfile.hdf5', mode='a') # doctest: +SKIP
... dset = f.create_dataset('/data', shape=x.shape,
...  chunks=x.chunks,
...  dtype='f8') # doctest: +SKIP
This example is valid syntax, but we were not able to check execution
>>> store(x, dset)  # doctest: +SKIP

Alternatively store many arrays at the same time

This example is valid syntax, but we were not able to check execution
>>> store([x, y, z], [dset1, dset2, dset3])  # doctest: +SKIP
See :

Back References

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

dask.array.core.store dask.array.core.to_zarr

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#914
type: <class 'function'>
Commit: