MCPcopy
hub / github.com/dask/dask / new_da_object

Function new_da_object

dask/array/core.py:6157–6169  ·  view source on GitHub ↗

Generic constructor for dask.array or dask.dataframe objects. Decides the appropriate output class based on the type of `meta` provided.

(dsk, name, chunks, meta=None, dtype=None)

Source from the content-addressed store, hash-verified

6155
6156
6157def new_da_object(dsk, name, chunks, meta=None, dtype=None):
6158 """Generic constructor for dask.array or dask.dataframe objects.
6159
6160 Decides the appropriate output class based on the type of `meta` provided.
6161 """
6162 if is_dataframe_like(meta) or is_series_like(meta) or is_index_like(meta):
6163 from dask.dataframe import from_graph
6164
6165 assert all(len(c) == 1 for c in chunks[1:])
6166 divisions = [None] * (len(chunks[0]) + 1)
6167 return from_graph(dict(dsk), meta, divisions, dsk.layers[name].keys(), name)
6168 else:
6169 return Array(dsk, name=name, chunks=chunks, meta=meta, dtype=dtype)
6170
6171
6172class BlockView:

Callers 1

blockwiseFunction · 0.90

Calls 7

is_dataframe_likeFunction · 0.90
is_series_likeFunction · 0.90
is_index_likeFunction · 0.90
allFunction · 0.90
from_graphFunction · 0.90
ArrayClass · 0.70
keysMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…