xarray_beam.Dataset.map_blocks¶
- Dataset.map_blocks(func, *, template=None, chunks=None, label=None)[source]¶
Map a function over the chunks of this dataset.
- Parameters:
func (Callable[[Dataset], Dataset]) – any function that does not change the size of dataset chunks, called like
func(chunk), wherechunkis an xarray.Dataset.template (Dataset | None) – new template for the resulting dataset. If not provided, an attempt will be made to infer the template by applying
functo the existing template, which requires thatfuncis implemented using dask compatible operations.chunks (Mapping[str, int] | None) – explicit new chunks sizes created by applying
func. If not provided, an attempt will be made to infer the new chunks based on the existing chunks, dimensions sizes and the new template.label (str | None) – A unique name for this stage of the pipeline. Defaults to
None, in which case a name will be generated.
- Returns:
New Dataset with updated chunks.
- Return type: