Skip to content

Commit 0d9c484

Browse files
authored
Advanced Indexing - Update Exercise solution
The small exercise at the bottom of the page declared two DataArrays, but only used one. The solution was still correct but confusing, so I reduced the needed variable declaration to the required one and renamed.
1 parent c178864 commit 0d9c484

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

intermediate/indexing/advanced-indexing.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,9 @@
374374
"\n",
375375
"indices = np.array([0, 2, 4])\n",
376376
"\n",
377-
"xs_da = xr.DataArray(indices, dims=\"points\")\n",
378-
"ys_da = xr.DataArray(indices, dims=\"points\")\n",
377+
"index_da = xr.DataArray(indices, dims=\"points\")\n",
379378
"\n",
380-
"subset_da = da.sel(x=xs_da, y=xs_da)\n",
379+
"subset_da = da.sel(x=index_da, y=index_da)\n",
381380
"subset_da\n",
382381
"```\n",
383382
":::\n",

0 commit comments

Comments
 (0)