semantique.ArrayProxy.reduce

semantique.ArrayProxy.reduce#

ArrayProxy.reduce(reducer, dimension=None, **kwargs)[source]#

Reduce the dimensionality of an array.

Reduces dimensionality by applying a reducer function that returns a single value for each column along a given dimension, e.g. a summary statistic or a boolean.

See here for an overview of the built-in reducer functions that can be chosen from (they should be referred to by their name, without the underscore at the end).

Parameters:
  • reducer (str) – Name of the reducer function to be applied.

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

  • **kwargs – Additional keyword arguments passed on to Array.reduce.

Returns:

ArrayProxy

Examples

>>> import semantique as sq
>>> sq.entity("water").reduce("count", "time")