From d460bbb3613383d607e4d4f8bc4d124cc228bed0 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Thu, 17 Sep 2020 17:11:39 -0700 Subject: [PATCH 1/2] Clearer Vectorized Indexing example --- doc/indexing.rst | 2 +- doc/whats-new.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/indexing.rst b/doc/indexing.rst index af8e44fb80b..4a1dd364793 100644 --- a/doc/indexing.rst +++ b/doc/indexing.rst @@ -339,7 +339,7 @@ MATLAB, or after using the :py:func:`numpy.ix_` helper: coords={"x": [0, 1, 2], "y": ["a", "b", "c", "d"]}, ) da - da[[0, 1], [1, 1]] + da[[1, 2, 2], [0, 3]] For more flexibility, you can supply :py:meth:`~xarray.DataArray` objects as indexers. diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 60a53512622..0a315538eaf 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -101,6 +101,8 @@ Documentation By `Sander van Rijn `_ - Update the contributing guide to use merges instead of rebasing and state that we squash-merge. (:pull:`4355`) By `Justus Magin `_. +- Updated Vectorized Indexing to a clearer example. + By `Maximilian Roos `_ Internal Changes ~~~~~~~~~~~~~~~~ From 06412a7d90283142f10a6cca41f706b408993f6f Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Thu, 17 Sep 2020 23:09:35 -0700 Subject: [PATCH 2/2] Feedback from @alexamici --- doc/indexing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/indexing.rst b/doc/indexing.rst index 4a1dd364793..58064582354 100644 --- a/doc/indexing.rst +++ b/doc/indexing.rst @@ -339,7 +339,7 @@ MATLAB, or after using the :py:func:`numpy.ix_` helper: coords={"x": [0, 1, 2], "y": ["a", "b", "c", "d"]}, ) da - da[[1, 2, 2], [0, 3]] + da[[0, 2, 2], [1, 3]] For more flexibility, you can supply :py:meth:`~xarray.DataArray` objects as indexers.