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

Function assign

dask/dataframe/dask_expr/_expr.py:1961–1974  ·  view source on GitHub ↗
(df, *pairs)

Source from the content-addressed store, hash-verified

1959
1960
1961def assign(df, *pairs):
1962 pairs = dict(partition(2, pairs))
1963 df = df.copy(deep=False)
1964 with warnings.catch_warnings():
1965 warnings.filterwarnings(
1966 "ignore",
1967 message="DataFrame is highly fragmented *",
1968 category=PerformanceWarning,
1969 )
1970 for name, val in pairs.items():
1971 if isinstance(val, Callable):
1972 val = val(df)
1973 df[name] = val
1974 return df
1975
1976
1977class Assign(Elemwise):

Callers

nothing calls this directly

Calls 3

partitionFunction · 0.85
copyMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected