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

Function test_columns_assignment

dask/dataframe/dask_expr/tests/test_collection.py:1407–1417  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1405
1406
1407def test_columns_assignment():
1408 df = pd.DataFrame({"x": [1, 2, 3, 4]})
1409 ddf = from_pandas(df, npartitions=2)
1410
1411 df2 = df.assign(y=df.x + 1, z=df.x - 1)
1412 df[["a", "b"]] = df2[["y", "z"]]
1413
1414 ddf2 = ddf.assign(y=ddf.x + 1, z=ddf.x - 1)
1415 ddf[["a", "b"]] = ddf2[["y", "z"]]
1416
1417 assert_eq(df, ddf)
1418
1419
1420def test_parent_mixed_column_assignment():

Callers

nothing calls this directly

Calls 3

assignMethod · 0.95
from_pandasFunction · 0.90
assert_eqFunction · 0.90

Tested by

no test coverage detected