semantique.processor.arrays.Array.reduce

Contents

semantique.processor.arrays.Array.reduce#

Array.reduce(reducer, dimension=None, track_types=True, **kwargs)[source]#

Apply the reduce verb to the array.

The reduce verb reduces the dimensionality of an array.

Parameters:
  • reducer (callable) – The reducer function to be applied.

  • dimension (str) – Name of the dimension to apply the reduction function to. If None, all dimensions are reduced.

  • track_types (bool) – Should the reducer promote the value type of the output object, based on the value type of the input object?

  • **kwargs – Additional keyword arguments passed on to the reducer function. These should not include a keyword argument “dim”, which is reserved for specifying the dimension to reduce over.

Returns:

xarray.DataArray

Raises:

exceptions.UnknownDimensionError – If a dimension with the given name is not present in the array.