MCPcopy Create free account
hub / github.com/dask/dask / to_dask_dataframe

Method to_dask_dataframe

dask/array/core.py:1827–1856  ·  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

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