Description
What happened?
The data structures documentation in user guide states that:
coords
: a list or dictionary of coordinates. If a list, it should be a
list of tuples where the first element is the dimension name and the second
xarray/doc/user-guide/data-structures.rst
Lines 57 to 59 in 48be376
But the example immediately following it has a list of coords
that is not a list of tuples:
locs = ["IA", "IL", "IN"]
times = pd.date_range("2000-01-01", periods=4)
foo = xr.DataArray(data, coords=[times, locs], dims=["time", "space"])
instead [times, locs]
is a just a list of lists.
xarray/doc/user-guide/data-structures.rst
Lines 68 to 70 in 48be376
I believe the code is correct though so just the description of coords
needs an update and should be clear that if you have just a list of coordinate lists, then the order of the outer list should match the order of the dims
list.
What did you expect to happen?
Example not to contradict the description of the type.
Minimal Complete Verifiable Example
N/A
MVCE confirmation
- Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
- Complete example — the example is self-contained, including all data and the text of any traceback.
- Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
- New issue — a search of GitHub Issues suggests this is not a duplicate.
- Recent environment — the issue occurs with the latest version of xarray and its dependencies.
Relevant log output
N/A
Anything else we need to know?
No response