flox.rechunk_for_blockwise

flox.rechunk_for_blockwise(array, axis, labels)[source]

Rechunks array so that group boundaries line up with chunk boundaries, allowing embarrassingly parallel group reductions.

This only works when the groups are sequential (e.g. labels = [0,0,0,1,1,1,1,2,2]). Such patterns occur when using .resample.

Parameters:
arrayDaskArray

Array to rechunk

axisint

Axis along which to rechunk the array.

labelsnp.ndarray

Group labels

Returns:
DaskArray

Rechunked array