Coordinates#

Creating coordinates#

Coordinates([coords, indexes])

Dictionary like container for Xarray coordinates (variables + indexes).

Coordinates.from_xindex(index)

Create Xarray coordinates from an existing Xarray index.

Coordinates.from_pandas_multiindex(midx, dim)

Wrap a pandas multi-index as Xarray coordinates (dimension + levels).

Attributes#

Coordinates.dims

Mapping from dimension names to lengths or tuple of dimension names.

Coordinates.sizes

Mapping from dimension names to lengths.

Coordinates.dtypes

Mapping from coordinate names to dtypes.

Coordinates.variables

Low level interface to Coordinates contents as dict of Variable objects.

Coordinates.indexes

Mapping of pandas.Index objects used for label based indexing.

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__(key)

Coordinates.__setitem__(key, value)

Coordinates.__delitem__(key)

Coordinates.update(other)

Update this Coordinates variables with other coordinate variables.

Coordinates.get(k[,d])

Coordinates.items()

Coordinates.keys()

Coordinates.values()

Coordinates contents#

Coordinates.to_dataset()

Convert these coordinates into a new Dataset.

Coordinates.to_index([ordered_dims])

Convert all index coordinates into a pandas.Index.

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.merge(other)

Merge two sets of coordinates to create a new Dataset

Coordinates.copy([deep, memo])

Return a copy of this Coordinates object.

Comparisons#

Coordinates.equals(other)

Two Coordinates objects are equal if they have matching variables, all of which are equal.

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(dataset)

Dictionary like container for Dataset coordinates (variables + indexes).

DataArrayCoordinates(dataarray)

Dictionary like container for DataArray coordinates (variables + indexes).

DataTreeCoordinates(datatree)

Dictionary like container for coordinates of a DataTree node (variables + indexes).