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

Function assign

dask/dataframe/methods.py:335–349  ·  view source on GitHub ↗
(df, *pairs)

Source from the content-addressed store, hash-verified

333
334
335def assign(df, *pairs):
336 # Only deep copy when updating an element
337 # (to avoid modifying the original)
338 # Setitem never modifies an array inplace with pandas 1.4 and up
339 pairs = dict(partition(2, pairs))
340 df = df.copy(deep=False)
341 with warnings.catch_warnings():
342 warnings.filterwarnings(
343 "ignore",
344 message="DataFrame is highly fragmented *",
345 category=PerformanceWarning,
346 )
347 for name, val in pairs.items():
348 df[name] = val
349 return df
350
351
352def unique(x, series_name=None):

Callers

nothing calls this directly

Calls 3

partitionFunction · 0.85
copyMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected