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

Function test_to_dask_array

dask/dataframe/tests/test_dataframe.py:2833–2848  ·  view source on GitHub ↗
(meta, as_frame, lengths)

Source from the content-addressed store, hash-verified

2831 ],
2832)
2833def test_to_dask_array(meta, as_frame, lengths):
2834 s = pd.Series([1, 2, 3, 4, 5], name="foo", dtype="i4")
2835 a = dd.from_pandas(s, chunksize=2)
2836
2837 if as_frame:
2838 a = a.to_frame()
2839
2840 result = a.to_dask_array(lengths=lengths, meta=meta)
2841 assert isinstance(result, da.Array)
2842
2843 expected_chunks = ((2, 2, 1),)
2844
2845 if as_frame:
2846 expected_chunks = expected_chunks + ((1,),)
2847
2848 assert result.chunks == expected_chunks
2849
2850
2851def test_to_dask_array_single_partition():

Callers

nothing calls this directly

Calls 2

to_dask_arrayMethod · 0.80
to_frameMethod · 0.45

Tested by

no test coverage detected