Skip to content

Commit 7c7e383

Browse files
mccloskeydcherian
andauthored
Clarify vectorized indexing documentation (#7747)
* Clarify vectorized indexing documentation * Update doc/user-guide/indexing.rst --------- Co-authored-by: Deepak Cherian <[email protected]>
1 parent c3224ef commit 7c7e383

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doc/user-guide/indexing.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ dimensions:
352352
ind_x = xr.DataArray([0, 1], dims=["x"])
353353
ind_y = xr.DataArray([0, 1], dims=["y"])
354354
da[ind_x, ind_y] # orthogonal indexing
355-
da[ind_x, ind_x] # vectorized indexing
356355
357356
Slices or sequences/arrays without named-dimensions are treated as if they have
358357
the same dimension which is indexed along:
@@ -399,6 +398,12 @@ These methods may also be applied to ``Dataset`` objects
399398
Vectorized indexing may be used to extract information from the nearest
400399
grid cells of interest, for example, the nearest climate model grid cells
401400
to a collection specified weather station latitudes and longitudes.
401+
To trigger vectorized indexing behavior
402+
you will need to provide the selection dimensions with a new
403+
shared output dimension name. In the example below, the selections
404+
of the closest latitude and longitude are renamed to an output
405+
dimension named "points":
406+
402407

403408
.. ipython:: python
404409

0 commit comments

Comments
 (0)