Skip to content

Commit

Permalink
Expect exception raising
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Jun 23, 2023
1 parent 2e100c4 commit 62ddb3b
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions advanced/apply_ufunc/automatic-vectorizing-numpy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"cell_type": "markdown",
"id": "6849dcdc-3484-4f41-8b23-51613d36812f",
"metadata": {
"tags": [],
"user_expressions": []
"tags": []
},
"source": [
"# Automatic Vectorization"
Expand All @@ -15,8 +14,7 @@
"cell_type": "markdown",
"id": "afc56d28-6e55-4967-b27d-28e2cc539cc7",
"metadata": {
"tags": [],
"user_expressions": []
"tags": []
},
"source": [
"Previously we looked at applying functions on numpy arrays, and the concept of core dimensions.\n",
Expand Down Expand Up @@ -48,7 +46,7 @@
"1. Understand vectorization\n",
"1. Learn how to apply such functions without loops using `apply_ufunc` by providing the `vectorize` keyword argument.\n",
"\n",
"### Core dimensions and looping\n",
"## Core dimensions and looping\n",
"\n",
"Let's say we want to\n",
"interpolate an array with two dimensions (`space`, `time`) over the `time` dimension, we might \n",
Expand Down Expand Up @@ -125,8 +123,7 @@
"cell_type": "markdown",
"id": "81356724-6c1a-4d4a-9a32-bb906a9419b2",
"metadata": {
"tags": [],
"user_expressions": []
"tags": []
},
"source": [
"## Review\n",
Expand Down Expand Up @@ -163,8 +160,7 @@
"cell_type": "markdown",
"id": "e3382658-14e1-4842-a618-ce7a27948c31",
"metadata": {
"tags": [],
"user_expressions": []
"tags": []
},
"source": [
"## Try nD input\n",
Expand All @@ -177,7 +173,9 @@
"execution_count": null,
"id": "1476bcce-cc7b-4252-90dd-f45502dffb09",
"metadata": {
"tags": []
"tags": [
"raises-exception"
]
},
"outputs": [],
"source": [
Expand All @@ -198,8 +196,7 @@
"cell_type": "markdown",
"id": "1d1da9c2-a634-4920-890c-74d9bec9eab9",
"metadata": {
"tags": [],
"user_expressions": []
"tags": []
},
"source": [
"We will use a \"wrapper\" function `interp1d_np` to examine what gets passed to `numpy.interp`"
Expand All @@ -210,7 +207,9 @@
"execution_count": null,
"id": "fa306dcf-eec3-425c-b278-42d15bbc0e4f",
"metadata": {
"tags": []
"tags": [
"raises-exception"
]
},
"outputs": [],
"source": [
Expand Down

0 comments on commit 62ddb3b

Please sign in to comment.