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

Function test_concat

dask/dataframe/tests/test_multi.py:564–588  ·  view source on GitHub ↗
(join)

Source from the content-addressed store, hash-verified

562
563@pytest.mark.parametrize("join", ["inner", "outer"])
564def test_concat(join):
565 pdf1 = pd.DataFrame(
566 {"x": [1, 2, 3, 4, 6, 7], "y": list("abcdef")}, index=[1, 2, 3, 4, 6, 7]
567 )
568 ddf1 = dd.from_pandas(pdf1, 2)
569 pdf2 = pd.DataFrame(
570 {"x": [1, 2, 3, 4, 6, 7], "y": list("abcdef")}, index=[8, 9, 10, 11, 12, 13]
571 )
572 ddf2 = dd.from_pandas(pdf2, 2)
573
574 # different columns
575 pdf3 = pd.DataFrame(
576 {"x": [1, 2, 3, 4, 6, 7], "z": list("abcdef")}, index=[8, 9, 10, 11, 12, 13]
577 )
578 ddf3 = dd.from_pandas(pdf3, 2)
579
580 kwargs = {"sort": False}
581
582 for dd1, dd2, pd1, pd2 in [
583 (ddf1, ddf2, pdf1, pdf2),
584 (ddf1, ddf3, pdf1, pdf3),
585 ]:
586 expected = pd.concat([pd1, pd2], join=join, **kwargs)
587 result = dd.concat([dd1, dd2], join=join, **kwargs)
588 assert_eq(result, expected)
589
590
591@pytest.mark.parametrize("join", ["inner", "outer"])

Callers

nothing calls this directly

Calls 1

assert_eqFunction · 0.90

Tested by

no test coverage detected