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#
Mapping from dimension names to lengths or tuple of dimension names.
Mapping from dimension names to lengths.
Mapping from coordinate names to dtypes.
Low level interface to Coordinates contents as dict of Variable objects.
Mapping of pandas.Index objects used for label based indexing.
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.__setitem__(key, value)
Coordinates.__or__(other)
Merge two sets of coordinates to create a new Coordinates object
Coordinates.update(other)
Update this Coordinates variables with other coordinate variables.
Coordinates.get(k[,d])
Coordinates contents#
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.drop_dims(drop_dims, *[, errors])
Drop dimensions and associated variables from this dataset.
Coordinates.drop_vars(names, *[, errors])
Drop variables from this Coordinates object.
Coordinates.merge(other, *[, compat])
Merge two sets of coordinates to create a new Dataset
Coordinates.copy([deep, memo])
Return a copy of this Coordinates object.
Coordinates.rename_vars([name_dict])
Returns a new object with renamed variables.
Coordinates.rename_dims([dims_dict])
Returns a new object with renamed dimensions only.
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).