Skip to content

Commit 152bd14

Browse files
committed
Add note about execution time varying by machine
1 parent b473822 commit 152bd14

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

lessons/06_Array_Operations_with_NumPy.ipynb

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@
4747
{
4848
"cell_type": "code",
4949
"execution_count": 1,
50-
"metadata": {
51-
"collapsed": false
52-
},
50+
"metadata": {},
5351
"outputs": [],
5452
"source": [
5553
"import numpy"
@@ -58,9 +56,7 @@
5856
{
5957
"cell_type": "code",
6058
"execution_count": 2,
61-
"metadata": {
62-
"collapsed": false
63-
},
59+
"metadata": {},
6460
"outputs": [
6561
{
6662
"name": "stdout",
@@ -91,9 +87,7 @@
9187
{
9288
"cell_type": "code",
9389
"execution_count": 3,
94-
"metadata": {
95-
"collapsed": false
96-
},
90+
"metadata": {},
9791
"outputs": [
9892
{
9993
"data": {
@@ -124,9 +118,7 @@
124118
{
125119
"cell_type": "code",
126120
"execution_count": 4,
127-
"metadata": {
128-
"collapsed": false
129-
},
121+
"metadata": {},
130122
"outputs": [],
131123
"source": [
132124
"nx = 81\n",
@@ -155,15 +147,15 @@
155147
"source": [
156148
"With our initial conditions all set up, let's first try running our original nested loop code, making use of the iPython \"magic\" function `%%timeit`, which will help us evaluate the performance of our code. \n",
157149
"\n",
158-
"**Note**: The `%%timeit` magic function will run the code several times and then give an average execution time as a result. If you have any figures being plotted within a cell where you run `%%timeit`, it will plot those figures repeatedly which can be a bit messy. "
150+
"**Note**: The `%%timeit` magic function will run the code several times and then give an average execution time as a result. If you have any figures being plotted within a cell where you run `%%timeit`, it will plot those figures repeatedly which can be a bit messy. \n",
151+
"\n",
152+
"The execution times below will vary from machine to machine. Don't expect your times to match these times, but you _should_ expect to see the same general trend in decreasing execution time as we switch to array operations."
159153
]
160154
},
161155
{
162156
"cell_type": "code",
163157
"execution_count": 5,
164-
"metadata": {
165-
"collapsed": false
166-
},
158+
"metadata": {},
167159
"outputs": [
168160
{
169161
"name": "stdout",
@@ -203,9 +195,7 @@
203195
{
204196
"cell_type": "code",
205197
"execution_count": 6,
206-
"metadata": {
207-
"collapsed": false
208-
},
198+
"metadata": {},
209199
"outputs": [
210200
{
211201
"name": "stdout",
@@ -240,9 +230,7 @@
240230
{
241231
"cell_type": "code",
242232
"execution_count": 7,
243-
"metadata": {
244-
"collapsed": false
245-
},
233+
"metadata": {},
246234
"outputs": [
247235
{
248236
"data": {
@@ -365,9 +353,9 @@
365353
"name": "python",
366354
"nbconvert_exporter": "python",
367355
"pygments_lexer": "ipython3",
368-
"version": "3.5.2"
356+
"version": "3.6.5"
369357
}
370358
},
371359
"nbformat": 4,
372-
"nbformat_minor": 0
360+
"nbformat_minor": 1
373361
}

0 commit comments

Comments
 (0)