semantique.ArrayProxy.trim

semantique.ArrayProxy.trim#

ArrayProxy.trim(dimension=None, **kwargs)[source]#

Trim the dimensions of an array.

Trimming means that all dimension coordinates for which all values are missing are removed from the array. The spatial dimensions are only trimmed at their edges, to preserve their regularity.

Parameters:
  • dimension (str) – Name of the dimension to be trimmed. If None, all dimensions will be trimmed.

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

Returns:

ArrayProxy

Examples

>>> import semantique as sq
>>> sq.entity("water").trim()
>>> sq.entity("water").trim("time")