MCPcopy
hub / github.com/dask/dask / to_dask_dataframe

Method to_dask_dataframe

dask/array/core.py:1829–1858  ·  view source on GitHub ↗

Convert dask Array to dask Dataframe Parameters ---------- columns: list or string list of column names if DataFrame, single string if Series index : dask.dataframe.Index, optional An optional *dask* Index to use for the output Series or DataF

(self, columns=None, index=None, meta=None)

Source from the content-addressed store, hash-verified

1827 return to_hdf5(filename, datapath, self, **kwargs)
1828
1829 def to_dask_dataframe(self, columns=None, index=None, meta=None):
1830 """Convert dask Array to dask Dataframe
1831
1832 Parameters
1833 ----------
1834 columns: list or string
1835 list of column names if DataFrame, single string if Series
1836 index : dask.dataframe.Index, optional
1837 An optional *dask* Index to use for the output Series or DataFrame.
1838
1839 The default output index depends on whether the array has any unknown
1840 chunks. If there are any unknown chunks, the output has ``None``
1841 for all the divisions (one per chunk). If all the chunks are known,
1842 a default index with known divisions is created.
1843
1844 Specifying ``index`` can be useful if you're conforming a Dask Array
1845 to an existing dask Series or DataFrame, and you would like the
1846 indices to match.
1847 meta : object, optional
1848 An optional `meta` parameter can be passed for dask
1849 to specify the concrete dataframe type to use for partitions of
1850 the Dask dataframe. By default, pandas DataFrame is used.
1851
1852 See Also
1853 --------
1854 dask.dataframe.from_dask_array
1855 """
1856 from dask.dataframe import from_dask_array
1857
1858 return from_dask_array(self, columns=columns, index=index, meta=meta)
1859
1860 def to_backend(self, backend: str | None = None, **kwargs):
1861 """Move to a new Array backend

Callers 4

test_from_xarrayFunction · 0.80
test_array_vs_dataframeFunction · 0.80
test_to_dask_dataframeFunction · 0.80

Calls 1

from_dask_arrayFunction · 0.90

Tested by 4

test_from_xarrayFunction · 0.64
test_array_vs_dataframeFunction · 0.64
test_to_dask_dataframeFunction · 0.64