def bag_zip(*bags):
 npartitions = bags[0].npartitions
 assert all(((bag.npartitions == npartitions) for bag in bags))
 name = ('zip-' + tokenize(*bags))
 dsk = dict((((name, i), (reify, ((zip,) + tuple(((bag.name, i) for bag in bags))))) for i in range(npartitions)))
 bags_dsk = merge(*(bag.dask for bag in bags))
 return Bag(merge(bags_dsk, dsk), name, npartitions)

def bag_zip ( * bags ) : npartitions = bags [ 0 ] . npartitions assert all ( ( ( bag . npartitions == npartitions ) for bag in bags ) ) name = ( 'zip-' + tokenize ( * bags ) ) dsk = dict ( ( ( ( name , i ) , ( reify , ( ( zip , ) + tuple ( ( ( bag . name , i ) for bag in bags ) ) ) ) ) for i in range ( npartitions ) ) ) bags_dsk = merge ( * ( bag . dask for bag in bags ) ) return Bag ( merge ( bags_dsk , dsk ) , name , npartitions )
partition-wise bag zip all passed bags must have the same number of partitions .