Skip to content

Commit 65eddca

Browse files
committed
docs
1 parent ca4202b commit 65eddca

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

doc/reshaping.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ Reordering dimensions
1818
---------------------
1919

2020
To reorder dimensions on a :py:class:`~xarray.DataArray` or across all variables
21-
on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`:
21+
on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`. An
22+
ellipsis (`...`) can be use to represent all other dimensions:
2223

2324
.. ipython:: python
2425
2526
ds = xr.Dataset({'foo': (('x', 'y', 'z'), [[[42]]]), 'bar': (('y', 'z'), [[24]])})
2627
ds.transpose('y', 'z', 'x')
28+
ds.transpose(..., 'x') # equivalent
2729
ds.transpose() # reverses all dimensions
2830
2931
Expand and squeeze dimensions

doc/whats-new.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ New Features
2222
~~~~~~~~~~~~
2323
- :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`)
2424
to represent all 'other' dimensions. For example, to move one dimension to the front,
25-
pass `.transpose('x', ...)`. (:pull:`3421`)
25+
use `.transpose('x', ...)`. (:pull:`3421`)
2626
By `Maximilian Roos <https://github.com/max-sixty>`_
2727
- Added integration tests against `pint <https://pint.readthedocs.io/>`_.
2828
(:pull:`3238`) by `Justus Magin <https://github.com/keewis>`_.

0 commit comments

Comments
 (0)