Dask logo

Iterate over Blocks

You can manually apply a function to each block by iterating over the blocks in the array.

For dataframes this looks very similar. Here we iterate over partitions in a list comprehension.

Potentially better graph

Another approach to this problem would be to add neighbors together repeatedly until you only have one left.

That graph optimizes to the same as our original.