semantique.processor.arrays.Array.trim

Contents

semantique.processor.arrays.Array.trim#

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

Apply the trim verb to the array.

The trim verb trims the dimensions of an array, meaning 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.

Returns:

xarray.DataArray

Raises:

exceptions.UnknownDimensionError – If a dimension with the given name is not present in the array.