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

Function _concat

dask/dataframe/core.py:36–55  ·  view source on GitHub ↗
(args, ignore_index=False)

Source from the content-addressed store, hash-verified

34
35
36def _concat(args, ignore_index=False):
37 if not args:
38 return args
39 if isinstance(first(core.flatten(args)), np.ndarray):
40 return da.core.concatenate3(args)
41 if not has_parallel_type(args[0]):
42 try:
43 return pd.Series(args)
44 except Exception:
45 return args
46 # We filter out empty partitions here because pandas frequently has
47 # inconsistent dtypes in results between empty and non-empty frames.
48 # Ideally this would be handled locally for each operation, but in practice
49 # this seems easier. TODO: don't do this.
50 args2 = [i for i in args if len(i)]
51 return (
52 args[0]
53 if not args2
54 else methods.concat(args2, uniform=True, ignore_index=ignore_index)
55 )
56
57
58def split_evenly(df, k):

Callers 15

_concat_wrapperFunction · 0.90
aggregateMethod · 0.90
aggregateMethod · 0.90
combineMethod · 0.90
aggregateMethod · 0.90
combineMethod · 0.90
aggregateMethod · 0.90
combineMethod · 0.90
_get_meta_map_partitionsFunction · 0.90
combineMethod · 0.90
aggregateMethod · 0.90
combineMethod · 0.90

Calls 2

has_parallel_typeFunction · 0.85
flattenMethod · 0.80

Tested by 2

test_concatFunction · 0.72