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

Function test_melt

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

Source from the content-addressed store, hash-verified

1509 ],
1510)
1511def test_melt(kwargs):
1512 pdf = pd.DataFrame(
1513 {
1514 "obj": list("abcd") * 5,
1515 "s1": list("XY") * 10,
1516 "s2": list("abcde") * 4,
1517 "int": np.random.randn(20),
1518 }
1519 )
1520 if pa:
1521 # If pyarrow is installed, test that `string[pyarrow]` dtypes
1522 # give the same result with `pandas` and `dask`
1523 pdf = pdf.astype({"s1": "string[pyarrow]", "s2": "string[pyarrow]"})
1524
1525 ddf = dd.from_pandas(pdf, 4)
1526
1527 list_eq(dd.melt(ddf, **kwargs), pd.melt(pdf, **kwargs))
1528 # test again as DataFrame method
1529 list_eq(ddf.melt(**kwargs), pdf.melt(**kwargs))
1530
1531
1532def 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