MCPcopy
hub / github.com/dask/dask / concat

Function concat

dask/bag/core.py:1857–1873  ·  view source on GitHub ↗

Concatenate many bags together, unioning all elements. >>> import dask.bag as db >>> a = db.from_sequence([1, 2, 3]) >>> b = db.from_sequence([4, 5, 6]) >>> c = db.concat([a, b]) >>> list(c) [1, 2, 3, 4, 5, 6]

(bags)

Source from the content-addressed store, hash-verified

1855
1856
1857def concat(bags):
1858 """Concatenate many bags together, unioning all elements.
1859
1860 >>> import dask.bag as db
1861 >>> a = db.from_sequence([1, 2, 3])
1862 >>> b = db.from_sequence([4, 5, 6])
1863 >>> c = db.concat([a, b])
1864
1865 >>> list(c)
1866 [1, 2, 3, 4, 5, 6]
1867 """
1868 token = tokenize(*bags)
1869 name = f"concat-{token}"
1870 counter = itertools.count(0)
1871 dsk = {(name, next(counter)): key for bag in bags for key in bag.__dask_keys__()}
1872 graph = HighLevelGraph.from_collections(name, dsk, dependencies=bags)
1873 return Bag(graph, name, len(dsk))
1874
1875
1876def reify(seq):

Callers 15

read_textFunction · 0.70
call_functionFunction · 0.50
test_read_bytesFunction · 0.50
test_read_bytes_blockFunction · 0.50
test_compressionFunction · 0.50
test_namesFunction · 0.50
test_open_files_writeFunction · 0.50
test_read_bytesFunction · 0.50
test_read_bytes_blockFunction · 0.50

Calls 5

BagClass · 0.85
from_collectionsMethod · 0.80
tokenizeFunction · 0.50
countMethod · 0.45
__dask_keys__Method · 0.45

Tested by 15

test_read_bytesFunction · 0.40
test_read_bytes_blockFunction · 0.40
test_compressionFunction · 0.40
test_namesFunction · 0.40
test_open_files_writeFunction · 0.40
test_read_bytesFunction · 0.40
test_read_bytes_blockFunction · 0.40
test_compressionFunction · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…