Skip to content

rewrite of the Coordinates section in the data structures guide #10323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions doc/user-guide/data-structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -808,16 +808,20 @@ For more examples and further discussion see :ref:`alignment and coordinate inhe
Coordinates
-----------

Coordinates are ancillary variables stored for ``DataArray`` and ``Dataset``
objects in the ``coords`` attribute:
The :py:class:`xarray.Coordinates` object is a dict-like container that contains coordinate variables and the associated indexes. It is mainly used as the return value of the ``coords`` property of the ``DataArray``, ``Dataset``, and ``DataTree``:

.. ipython:: python

foo.coords
ds.coords
dt.coords

But can also be used to customize the behavior of the constructors of these classes or to transfer or combine coordinates from different objects.

Coordinate variables
~~~~~~~~~~~~~~~~~~~~

Unlike attributes, xarray *does* interpret and persist coordinates in
operations that transform xarray objects. There are two types of coordinates
in xarray:
Coordinate variables (or simply coordinates) are ancillary variables stored in ``DataArray``, ``Dataset``, and ``DataTree`` objects. Unlike attributes, xarray *does* interpret coordinates in operations that transform xarray objects. There are two types of coordinates in xarray:

- **dimension coordinates** are one dimensional coordinates with a name equal
to their sole dimension (marked by ``*`` when printing a dataset or data
Expand Down
Loading