Skip to content

Commit 08e762e

Browse files
negin513pre-commit-ci[bot]scottyhq
authored
Minor changes and typo fixes (#286)
* adding the links to all indexing materials * typo fix + remove a redundant example. * updates to indexing * updating advanced indexing * advanced indexing * update indexing redundancies * adding excercise * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * few fixes for build fail * updating header * updating header * align with new exercise syntax * adding advanced indexing * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add numpy advanced indexing * update learning objectives * few minor updates and wording changes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update indexing docs * quick merge conflict resolve * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update docs * adding np.ix_ * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix merge * typo fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * quick typo fix * typo * typo * typo fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Scott Henderson <[email protected]> Co-authored-by: Scott Henderson <[email protected]>
1 parent 8b46581 commit 08e762e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Diff for: intermediate/01-high-level-computation-patterns.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@
657657
":class: dropdown\n",
658658
"\n",
659659
"```python\n",
660-
"data.coarsen(lat=5, lon=5, boundary=\"trim\").reduce(np.mean).plot();\n",
660+
"data.coarsen(lat=5, lon=5, boundary=\"trim\").reduce(np.ptp).plot();\n",
661661
"```\n",
662662
":::\n",
663663
"::::"

Diff for: intermediate/indexing/advanced-indexing.ipynb

+6-4
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
"\n",
155155
"ds = xr.tutorial.load_dataset(\"air_temperature\")\n",
156156
"da_air = ds.air\n",
157-
"ds"
157+
"da_air"
158158
]
159159
},
160160
{
@@ -171,7 +171,7 @@
171171
"cell_type": "markdown",
172172
"metadata": {},
173173
"source": [
174-
"👆 please notice how the output of the indexing example above resulted in an array of size `3x4`"
174+
"👆 Please note that the output shape in the example above is `4x3` because the latitude indexer selects 4 rows, and the longitude indexer selects 3 columns."
175175
]
176176
},
177177
{
@@ -239,7 +239,9 @@
239239
"To trigger vectorized indexing behavior, you will need to provide the selection dimensions with a new **shared** output dimension name. This means that the dimensions of both indexers must be the same, and the output will have the same dimension name as the indexers.\n",
240240
"```\n",
241241
"\n",
242-
"Let's see how this works with an example. A researcher wants to find the nearest climate model grid cell to a collection of observation sites. She has the latitude and longitude of the observation sites as following:"
242+
"Let's see how this works with an example:\n",
243+
"\n",
244+
"A researcher wants to find the nearest climate model grid cell to a collection of observation sites. They have the latitude and longitude of the observation sites as following:"
243245
]
244246
},
245247
{
@@ -257,7 +259,7 @@
257259
"cell_type": "markdown",
258260
"metadata": {},
259261
"source": [
260-
"If the researcher use the lists to index the DataArray, they will get the orthogonal indexing behavior, which is not what they wants."
262+
"If the researcher use the lists to index the DataArray, they will get the orthogonal indexing behavior, which is not what they want."
261263
]
262264
},
263265
{

0 commit comments

Comments
 (0)