Skip to content

Commit

Permalink
Minor changes and typo fixes (#286)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
4 people authored Jul 8, 2024
1 parent 8b46581 commit 08e762e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion intermediate/01-high-level-computation-patterns.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@
":class: dropdown\n",
"\n",
"```python\n",
"data.coarsen(lat=5, lon=5, boundary=\"trim\").reduce(np.mean).plot();\n",
"data.coarsen(lat=5, lon=5, boundary=\"trim\").reduce(np.ptp).plot();\n",
"```\n",
":::\n",
"::::"
Expand Down
10 changes: 6 additions & 4 deletions intermediate/indexing/advanced-indexing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"\n",
"ds = xr.tutorial.load_dataset(\"air_temperature\")\n",
"da_air = ds.air\n",
"ds"
"da_air"
]
},
{
Expand All @@ -171,7 +171,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"👆 please notice how the output of the indexing example above resulted in an array of size `3x4`"
"👆 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."
]
},
{
Expand Down Expand Up @@ -239,7 +239,9 @@
"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",
"```\n",
"\n",
"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:"
"Let's see how this works with an example:\n",
"\n",
"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:"
]
},
{
Expand All @@ -257,7 +259,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"If the researcher use the lists to index the DataArray, they will get the orthogonal indexing behavior, which is not what they wants."
"If the researcher use the lists to index the DataArray, they will get the orthogonal indexing behavior, which is not what they want."
]
},
{
Expand Down

0 comments on commit 08e762e

Please sign in to comment.