semantique.ArrayProxy.groupby

semantique.ArrayProxy.groupby#

ArrayProxy.groupby(grouper, **kwargs)[source]#

Group the values in an array.

Splits the array into distinct subsets that each comprise a group of pixels sharing similar coordinates of a particular dimension, e.g. each group may correspond to a year.

Parameters:
  • grouper (ArrayProxy or CollectionProxy) – Proxy of an array which can be aligned to the same shape as the input array. Pixels in the input array that have equal values in the grouper will be grouped together. Alternatively it may be a proxy of a collection of such arrays. Then, pixels in the input array that have equal values in all of the grouper arrays will be grouped together.

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

Returns:

CollectionProxy

Examples

>>> import semantique as sq
>>> sq.entity("water").groupby(sq.self().extract("time", "year"))