semantique.ArrayProxy.filter_time

semantique.ArrayProxy.filter_time#

ArrayProxy.filter_time(*filterer, **kwargs)[source]#

Filter an array along the temporal dimension.

This verb is a shortcut for first extracting the temporal dimension with the extract() verb (optionally only a specific component of that dimension, such as year or month), then evaluating a relational operator on the coordinates of this dimension using the evaluate() verb, and finally using the output of that operation as filterer in the filter() verb.

Parameters:
  • *filterer – Either two positional arguments consisting of respectively the name of the relational operator and value of the right-hand side operand to be used in the expression, or three positional arguments consisting of respectively the name of the component to be extracted from the temporal dimension, the relational operator and value of the right-hand side operand to be used in the expression.

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

Returns:

ArrayProxy

Examples

>>> import semantique as sq
>>> sq.entity("water").filter_time("after", sq.time_instant("2021-12-31"))
>>> sq.entity("water").filter_time("year", "equals", 2020)