xarray.Variable.squeeze

xarray.Variable.squeeze#

Variable.squeeze(dim=None)[source]#

Return a new object with squeezed data.

Parameters

dim (None or str or tuple of str, optional) – Selects a subset of the length one dimensions. If a dimension is selected with length greater than one, an error is raised. If None, all length one dimensions are squeezed.

Returns

squeezed (same type as caller) – This object, but with with all or a subset of the dimensions of length 1 removed.

See also

numpy.squeeze