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

Function test_columns_assignment

dask/dataframe/tests/test_dataframe.py:3645–3655  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3643
3644
3645def test_columns_assignment():
3646 df = pd.DataFrame({"x": [1, 2, 3, 4]})
3647 ddf = dd.from_pandas(df, npartitions=2)
3648
3649 df2 = df.assign(y=df.x + 1, z=df.x - 1)
3650 df[["a", "b"]] = df2[["y", "z"]]
3651
3652 ddf2 = ddf.assign(y=ddf.x + 1, z=ddf.x - 1)
3653 ddf[["a", "b"]] = ddf2[["y", "z"]]
3654
3655 assert_eq(df, ddf)
3656
3657
3658def test_attribute_assignment():

Callers

nothing calls this directly

Calls 2

assignMethod · 0.95
assert_eqFunction · 0.90

Tested by

no test coverage detected