# Coordinates

## Creating coordinates

| [`Coordinates`](../generated/xarray.Coordinates.html.md#xarray.Coordinates)([coords, indexes])                                       | Dictionary like container for Xarray coordinates (variables + indexes).   |
|------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| [`Coordinates.from_xindex`](../generated/xarray.Coordinates.from_xindex.html.md#xarray.Coordinates.from_xindex)(index)                           | Create Xarray coordinates from an existing Xarray index.                  |
| [`Coordinates.from_pandas_multiindex`](../generated/xarray.Coordinates.from_pandas_multiindex.html.md#xarray.Coordinates.from_pandas_multiindex)(midx, dim) | Wrap a pandas multi-index as Xarray coordinates (dimension + levels).     |

## Attributes

| [`Coordinates.dims`](../generated/xarray.Coordinates.dims.html.md#xarray.Coordinates.dims)           | Mapping from dimension names to lengths or tuple of dimension names.     |
|-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
| [`Coordinates.sizes`](../generated/xarray.Coordinates.sizes.html.md#xarray.Coordinates.sizes)         | Mapping from dimension names to lengths.                                 |
| [`Coordinates.dtypes`](../generated/xarray.Coordinates.dtypes.html.md#xarray.Coordinates.dtypes)       | Mapping from coordinate names to dtypes.                                 |
| [`Coordinates.variables`](../generated/xarray.Coordinates.variables.html.md#xarray.Coordinates.variables) | Low level interface to Coordinates contents as dict of Variable objects. |
| [`Coordinates.indexes`](../generated/xarray.Coordinates.indexes.html.md#xarray.Coordinates.indexes)     | Mapping of pandas.Index objects used for label based indexing.           |
| [`Coordinates.xindexes`](../generated/xarray.Coordinates.xindexes.html.md#xarray.Coordinates.xindexes)   | Mapping of `Index` objects used for label based indexing.                |

## Dictionary Interface

Coordinates implement the mapping interface with keys given by variable names
and values given by `DataArray` objects.

| [`Coordinates.__getitem__`](../generated/xarray.Coordinates.__getitem__.html.md#xarray.Coordinates.__getitem__)(key)        |                                                                    |
|---------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| [`Coordinates.__setitem__`](../generated/xarray.Coordinates.__setitem__.html.md#xarray.Coordinates.__setitem__)(key, value) |                                                                    |
| [`Coordinates.__delitem__`](../generated/xarray.Coordinates.__delitem__.html.md#xarray.Coordinates.__delitem__)(key)        |                                                                    |
| [`Coordinates.__or__`](../generated/xarray.Coordinates.__or__.html.md#xarray.Coordinates.__or__)(other)                | Merge two sets of coordinates to create a new Coordinates object   |
| [`Coordinates.update`](../generated/xarray.Coordinates.update.html.md#xarray.Coordinates.update)(other)                | Update this Coordinates variables with other coordinate variables. |
| [`Coordinates.get`](../generated/xarray.Coordinates.get.html.md#xarray.Coordinates.get)(k[,d])                      |                                                                    |
| [`Coordinates.items`](../generated/xarray.Coordinates.items.html.md#xarray.Coordinates.items)()                       |                                                                    |
| [`Coordinates.keys`](../generated/xarray.Coordinates.keys.html.md#xarray.Coordinates.keys)()                         |                                                                    |
| [`Coordinates.values`](../generated/xarray.Coordinates.values.html.md#xarray.Coordinates.values)()                     |                                                                    |

## Coordinates contents

| [`Coordinates.to_dataset`](../generated/xarray.Coordinates.to_dataset.html.md#xarray.Coordinates.to_dataset)()                      | Convert these coordinates into a new Dataset.                                                                                                       |
|------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| [`Coordinates.to_index`](../generated/xarray.Coordinates.to_index.html.md#xarray.Coordinates.to_index)([ordered_dims])            | Convert all index coordinates into a [`pandas.Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index).   |
| [`Coordinates.assign`](../generated/xarray.Coordinates.assign.html.md#xarray.Coordinates.assign)([coords])                      | Assign new coordinates (and indexes) to a Coordinates object, returning a new object with all the original coordinates in addition to the new ones. |
| [`Coordinates.drop_dims`](../generated/xarray.Coordinates.drop_dims.html.md#xarray.Coordinates.drop_dims)(drop_dims, \*[, errors]) | Drop dimensions and associated variables from this dataset.                                                                                         |
| [`Coordinates.drop_vars`](../generated/xarray.Coordinates.drop_vars.html.md#xarray.Coordinates.drop_vars)(names, \*[, errors])     | Drop variables from this Coordinates object.                                                                                                        |
| [`Coordinates.merge`](../generated/xarray.Coordinates.merge.html.md#xarray.Coordinates.merge)(other, \*[, compat])             | Merge two sets of coordinates to create a new Dataset                                                                                               |
| [`Coordinates.copy`](../generated/xarray.Coordinates.copy.html.md#xarray.Coordinates.copy)([deep, memo])                      | Return a copy of this Coordinates object.                                                                                                           |
| [`Coordinates.rename_vars`](../generated/xarray.Coordinates.rename_vars.html.md#xarray.Coordinates.rename_vars)([name_dict])         | Returns a new object with renamed variables.                                                                                                        |
| [`Coordinates.rename_dims`](../generated/xarray.Coordinates.rename_dims.html.md#xarray.Coordinates.rename_dims)([dims_dict])         | Returns a new object with renamed dimensions only.                                                                                                  |

## Comparisons

| [`Coordinates.equals`](../generated/xarray.Coordinates.equals.html.md#xarray.Coordinates.equals)(other)       | Two Coordinates objects are equal if they have matching variables, all of which are equal.   |
|------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| [`Coordinates.identical`](../generated/xarray.Coordinates.identical.html.md#xarray.Coordinates.identical)(other) | Like equals, but also checks all variable attributes.                                        |

## Proxies

Coordinates that are accessed from the `coords` property of Dataset, DataArray
and DataTree objects, respectively.

| [`DatasetCoordinates`](../generated/xarray.core.coordinates.DatasetCoordinates.html.md#xarray.core.coordinates.DatasetCoordinates)(dataset)       | Dictionary like container for Dataset coordinates (variables + indexes).            |
|-------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| [`DataArrayCoordinates`](../generated/xarray.core.coordinates.DataArrayCoordinates.html.md#xarray.core.coordinates.DataArrayCoordinates)(dataarray) | Dictionary like container for DataArray coordinates (variables + indexes).          |
| [`DataTreeCoordinates`](../generated/xarray.core.coordinates.DataTreeCoordinates.html.md#xarray.core.coordinates.DataTreeCoordinates)(datatree)    | Dictionary like container for coordinates of a DataTree node (variables + indexes). |
