semantique.ArrayProxy.groupby_time

semantique.ArrayProxy.groupby_time#

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

Group an array along the temporal dimension.

This verb is a shortcut for first extracting the temporal dimension with the extract() verb (usually only a specific component of that dimension, such as year or month), 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 temporal dimension coordinates to be extracted, e.g. year, month or day. 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_time("year")