semantique.ArrayProxy.groupby_space

semantique.ArrayProxy.groupby_space#

ArrayProxy.groupby_space(component=None, **kwargs)[source]#

Group an array along the spatial dimension.

This verb is a shortcut for first extracting the spatial dimension with the extract() verb (usually only a specific component of that dimension, such as the spatial feature indices), and then using the resulting one-dimensional array as grouper in the groupby() verb.

Parameters:
  • component (str or list of str, optional) – Name of a specific component of the spatial dimension coordinates to be extracted, e.g. feature. Can also be a list of multiple of such components, in case the groups should be defined by multiple groupers.

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

Returns:

CollectionProxy

Examples

>>> import semantique as sq
>>> sq.entity("water").groupby_space("feature")