xarray.Dataset.squeeze¶
- Dataset.squeeze(dim=None)¶
Returns a new dataset 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 : Dataset
This dataset, but with with all or a subset of the dimensions of length 1 removed.
See also
Notes
Although this operation returns a view of each variable’s data, it is not lazy – all variable data will be fully loaded.