# xarray.Dataset.squeeze

#### Dataset.squeeze(dim=None, drop=False, axis=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/common.py#L436-L467)

Return a new object with squeezed data.

* **Parameters:**
  * **dim** ([`None`](https://docs.python.org/3/builtins/constants.html#None) or `Hashable` or [iterable](https://docs.python.org/3/glossary.html#term-iterable) of `Hashable`, *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.
  * **drop** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool), *default*: [`False`](https://docs.python.org/3/builtins/constants.html#False)) – If `drop=True`, drop squeezed coordinates instead of making them
    scalar.
  * **axis** ([`None`](https://docs.python.org/3/builtins/constants.html#None) or [`int`](https://docs.python.org/3/builtins/functions.html#int) or [iterable](https://docs.python.org/3/glossary.html#term-iterable) of [`int`](https://docs.python.org/3/builtins/functions.html#int), *optional*) – Like dim, but positional.
* **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`](https://numpy.org/doc/stable/reference/generated/numpy.squeeze.html#numpy.squeeze)
