semantique.processor.arrays.Array.groupby#
- Array.groupby(grouper, labels_as_names=True, **kwargs)[source]#
Apply the groupby verb to the array.
The groupby verb groups the values in an array.
- Parameters:
grouper (
xarray.DataArray
orCollection
) – 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 collection of such arrays. Then, pixels in the input array that have equal values in all of the grouper arrays will be grouped together.labels_as_names (
bool
) – If value labels are defined, should they be used as group names instead of the values themselves?**kwargs – Ignored.
- Returns:
- Raises:
exceptions.MissingDimensionError – If the grouper is zero-dimensional.
exceptions.UnknownDimensionError – If the grouper contains dimensions that are not present in the input.
exceptions.MixedDimensionsError – If the grouper is a collection and its elements don’t all have the same dimensions.