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 thegroupby()
verb.- Parameters:
component (
str
orlist
ofstr
, 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:
Examples
>>> import semantique as sq >>> sq.entity("water").groupby_space("feature")