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

Method to_dask_dataframe

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

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