Skip to content

Commit 600c31b

Browse files
author
Holger Wolff
committed
some more minor modifications to apply-ufunc
1 parent db24f14 commit 600c31b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

posts/2023-12-12-apply-ufunc.ipynb

+8-3
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,19 @@
4141
"source": [
4242
"## Generate some data for the testing\n",
4343
"\n",
44-
"The following function just creates some data array with random numbers in it."
44+
"The following function just creates some data array with random numbers in it.\n",
45+
"I will use this function several times over the course of this article to generate data arrays of various shapes and sizes, but the actualy contents of this function is not that relevant."
4546
]
4647
},
4748
{
4849
"cell_type": "code",
4950
"execution_count": 2,
5051
"id": "46655528-5d17-44c7-bcad-735a6db4aebe",
51-
"metadata": {},
52+
"metadata": {
53+
"jupyter": {
54+
"source_hidden": true
55+
}
56+
},
5257
"outputs": [],
5358
"source": [
5459
"def create_dataarray(nlat, nlon, ntime=None, seed=1000):\n",
@@ -538,7 +543,7 @@
538543
"2. The arrays that contain the data to be passed to the function.\n",
539544
" In our case this is only one array: `small_da`\n",
540545
"\n",
541-
"Our function expects scalar values, so we need to tell the call to `apply_ufunc` that it needs to vectorise the array. \n",
546+
"Our function `limit` expects scalar values, so we need to tell the call to `apply_ufunc` that it needs to vectorise the array. \n",
542547
"This is done by the `vectorize=True` parameter. \n",
543548
"(Note the American spelling.)\n",
544549
"It means that the method cuts the array into its elements, feeds each element individually into the function, and finally collects the returned values into a new array:"

0 commit comments

Comments
 (0)