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

Function test_melt

dask/dataframe/tests/test_multi.py:1508–1524  ·  view source on GitHub ↗
(kwargs)

Source from the content-addressed store, hash-verified

1506 ],
1507)
1508def test_melt(kwargs):
1509 pdf = pd.DataFrame(
1510 {
1511 "obj": list("abcd") * 5,
1512 "s1": list("XY") * 10,
1513 "s2": list("abcde") * 4,
1514 "int": np.random.randn(20),
1515 }
1516 )
1517 # Test that `string[pyarrow]` dtypes give the same result with `pandas` and `dask`
1518 pdf = pdf.astype({"s1": "string[pyarrow]", "s2": "string[pyarrow]"})
1519
1520 ddf = dd.from_pandas(pdf, 4)
1521
1522 list_eq(dd.melt(ddf, **kwargs), pd.melt(pdf, **kwargs))
1523 # test again as DataFrame method
1524 list_eq(ddf.melt(**kwargs), pdf.melt(**kwargs))
1525
1526
1527def test_cheap_inner_merge_with_pandas_object():

Callers

nothing calls this directly

Calls 3

meltMethod · 0.95
list_eqFunction · 0.85
astypeMethod · 0.45

Tested by

no test coverage detected