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

Method to_dask_dataframe

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

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