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

Function test_to_dask_array

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

Source from the content-addressed store, hash-verified

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