dask 2021.10.0

ParametersReturnsBackRef
asarray(a, allow_unknown_chunksizes=False, dtype=None, order=None, *, like=None, **kwargs)

Parameters

a : array-like

Input data, in any form that can be converted to a dask array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists and ndarrays.

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.

dtype : data-type, optional

By default, the data-type is inferred from the input data.

order : {‘C’, ‘F’, ‘A’, ‘K’}, optional

Memory layout. ‘A’ and ‘K’ depend on the order of input array a. ‘C’ row-major (C-style), ‘F’ column-major (Fortran-style) memory representation. ‘A’ (any) means ‘F’ if a is Fortran contiguous, ‘C’ otherwise ‘K’ (keep) preserve input order. Defaults to ‘C’.

like: array-like :

Reference object to allow the creation of Dask arrays with chunks that are not NumPy arrays. If an array-like passed in as like supports the __array_function__ protocol, the chunk type of the resulting array will be definde by it. In this case, it ensures the creation of a Dask array compatible with that passed in via this argument. If like is a Dask array, the chunk type of the resulting array will be defined by the chunk type of like . Requires NumPy 1.20.0 or higher.

Returns

out : dask array

Dask array interpretation of a.

Convert the input to a dask array.

Examples

This example is valid syntax, but we were not able to check execution
>>> import dask.array as da
... import numpy as np
... x = np.arange(3)
... da.asarray(x) dask.array<array, shape=(3,), dtype=int64, chunksize=(3,), chunktype=numpy.ndarray>
This example is valid syntax, but we were not able to check execution
>>> y = [[1, 2, 3], [4, 5, 6]]
... da.asarray(y) dask.array<array, shape=(2, 3), dtype=int64, chunksize=(2, 3), chunktype=numpy.ndarray>
See :

Back References

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

dask.array.core.asarray

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