xarray.DataArray.chunk

DataArray.chunk(chunks: Union[None, numbers.Number, Tuple[numbers.Number, ...], Tuple[Tuple[numbers.Number, ...], ...], Mapping[Hashable, Union[None, numbers.Number, Tuple[numbers.Number, ...]]]] = None, name_prefix: str = 'xarray-', token: Optional[str] = None, lock: bool = False) → xarray.core.dataarray.DataArray

Coerce this array’s data into a dask arrays with the given chunks.

If this variable is a non-dask array, it will be converted to dask array. If it’s a dask array, it will be rechunked to the given chunk sizes.

If neither chunks is not provided for one or more dimensions, chunk sizes along that dimension will not be updated; non-dask arrays will be converted into dask arrays with a single block.

Parameters
chunksint, tuple or mapping, optional

Chunk sizes along each dimension, e.g., 5, (5, 5) or {'x': 5, 'y': 5}.

name_prefixstr, optional

Prefix for the name of the new dask array.

tokenstr, optional

Token uniquely identifying this array.

lockoptional

Passed on to dask.array.from_array(), if the array is not already as dask array.

Returns
chunkedxarray.DataArray