# xarray.IndexVariable.squeeze

#### IndexVariable.squeeze(dim=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/variable.py#L1366-L1387)

Return a new object with squeezed data.

* **Parameters:**
  **dim** ([`None`](https://docs.python.org/3/builtins/constants.html#None) or [`str`](https://docs.python.org/3/builtins/stdtypes.html#str) or [`tuple`](https://docs.python.org/3/builtins/stdtypes.html#tuple) of [`str`](https://docs.python.org/3/builtins/stdtypes.html#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`](https://numpy.org/doc/stable/reference/generated/numpy.squeeze.html#numpy.squeeze)
