Skip to content

Commit ed77943

Browse files
committed
Rerun creation of html and pdf (after minor updates)
1 parent 4a5b958 commit ed77943

12 files changed

+190
-5355
lines changed

html/02-powerful-calculator.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12530,7 +12530,8 @@ <h2 id="Mathematical-functions">Mathematical functions<a class="anchor-link" hre
1253012530
<div class="prompt input_prompt">In&nbsp;[18]:</div>
1253112531
<div class="inner_cell">
1253212532
<div class="input_area">
12533-
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">help</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">exp</span><span class="p">)</span>
12533+
<div class=" highlight hl-ipython3"><pre><span></span><span class="c1"># NBVAL_IGNORE_OUTPUT</span>
12534+
<span class="n">help</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">exp</span><span class="p">)</span>
1253412535
</pre></div>
1253512536

1253612537
</div>
@@ -13180,7 +13181,8 @@ <h2 id="Impossible-equations">Impossible equations<a class="anchor-link" href="#
1318013181
</li>
1318113182
</ol>
1318213183
<p>Some computer science literature uses the following notation to express assignments and to avoid the confusion with mathematical equations:</p>
13183-
$$x \leftarrow x + 1$$<p>Let’s apply our two-step rule to the assignment <code>x = x + 1</code> given above:</p>
13184+
<p>$$x \leftarrow x + 1$$</p>
13185+
<p>Let’s apply our two-step rule to the assignment <code>x = x + 1</code> given above:</p>
1318413186
<ol>
1318513187
<li><p>Evaluate the value on the right hand side of the equal sign: for this we need to know what the current value of <code>x</code> is. Let’s assume <code>x</code> is currently <code>4</code>. In that case, the right hand side <code>x+1</code> evaluates to <code>5</code>.</p>
1318613188
</li>

html/03-data-types-structures.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12535,16 +12535,17 @@ <h3 id="Functions-applicable-to-all-types-of-numbers">Functions applicable to al
1253512535
<h2 id="Sequences">Sequences<a class="anchor-link" href="#Sequences">&#182;</a></h2><p>Strings, lists and tuples are <em>sequences</em>. They can be <em>indexed</em> and <em>sliced</em> in the same way.</p>
1253612536
<p>Tuples and strings are “immutable” (which basically means we can’t change individual elements within the tuple, and we cannot change individual characters within a string) whereas lists are “mutable” (<em>.i.e</em> we can change elements in a list.)</p>
1253712537
<p>Sequences share the following operations</p>
12538-
<table>
12539-
<tr><td>`a[i]`</td><td>returns *i*-th element of `a`</td></tr>
12540-
<tr><td>`a[i:j]`</td><td>returns elements *i* up to *j* − 1</td></tr>
12541-
<tr><td>`len(a)`</td><td>returns number of elements in sequence</td></tr>
12542-
<tr><td>`min(a)`</td><td>returns smallest value in sequence</td></tr>
12543-
<tr><td>`max(a)`</td><td>returns largest value in sequence</td></tr>
12544-
<tr><td>`x in a`</td><td>returns `True` if `x` is element in `a`</td></tr>
12545-
<tr><td>`a + b`</td><td>concatenates `a` and `b`</td></tr>
12546-
<tr><td>`n * a`</td><td>creates `n` copies of sequence `a`</td></tr>
12547-
</table>
12538+
<ul>
12539+
<li><code>a[i]</code> returns i-th element of <code>a</code></li>
12540+
<li><code>a[i:j]</code> returns elements i up to j-1</li>
12541+
<li><code>len(a)</code> returns number of elements in sequence</li>
12542+
<li><code>min(a)</code> returns smallest value in sequence</li>
12543+
<li><code>max(a)</code> returns largest value in sequence</li>
12544+
<li><code>x in a</code> returns <code>True</code> if <code>x</code> is element in <code>a</code></li>
12545+
<li><code>a + b</code> concatenates <code>a</code> and <code>b</code></li>
12546+
<li><code>n * a</code> creates <code>n</code> copies of sequence <code>a</code></li>
12547+
</ul>
12548+
1254812549
</div>
1254912550
</div>
1255012551
</div>

html/04-introspection.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12466,7 +12466,8 @@ <h2 id="help">help<a class="anchor-link" href="#help">&#182;</a></h2><ul>
1246612466
<div class="prompt input_prompt">In&nbsp;[15]:</div>
1246712467
<div class="inner_cell">
1246812468
<div class="input_area">
12469-
<div class=" highlight hl-ipython3"><pre><span></span><span class="kn">import</span> <span class="nn">math</span>
12469+
<div class=" highlight hl-ipython3"><pre><span></span><span class="c1"># NBVAL_IGNORE_OUTPUT</span>
12470+
<span class="kn">import</span> <span class="nn">math</span>
1247012471
<span class="n">help</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">)</span>
1247112472
</pre></div>
1247212473

html/07-functions-modules.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12527,7 +12527,7 @@ <h3 id="Creating-modules">Creating modules<a class="anchor-link" href="#Creating
1252712527

1252812528

1252912529
<div class="output_subarea output_stream output_stdout output_text">
12530-
<pre>Writing module1.py
12530+
<pre>Overwriting module1.py
1253112531
</pre>
1253212532
</div>
1253312533
</div>
@@ -12699,7 +12699,7 @@ <h3 id="Example-1">Example 1<a class="anchor-link" href="#Example-1">&#182;</a><
1269912699

1270012700

1270112701
<div class="output_subarea output_stream output_stdout output_text">
12702-
<pre>Writing vectools.py
12702+
<pre>Overwriting vectools.py
1270312703
</pre>
1270412704
</div>
1270512705
</div>
@@ -12740,7 +12740,7 @@ <h3 id="Example-1">Example 1<a class="anchor-link" href="#Example-1">&#182;</a><
1274012740

1274112741
<div class="output_subarea output_stream output_stdout output_text">
1274212742
<pre>The norm of [0 1 2] is 2.23606797749979.
12743-
The unitvector in direction of [0 1 2] is [ 0. 0.4472136 0.89442719].
12743+
The unitvector in direction of [0 1 2] is [0. 0.4472136 0.89442719].
1274412744
</pre>
1274512745
</div>
1274612746
</div>

html/08-functional-tools.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11856,7 +11856,7 @@ <h2 id="Anonymous-functions">Anonymous functions<a class="anchor-link" href="#An
1185611856

1185711857

1185811858
<div class="output_text output_subarea output_execute_result">
11859-
<pre>&lt;function __main__.f&gt;</pre>
11859+
<pre>&lt;function __main__.f(x)&gt;</pre>
1186011860
</div>
1186111861

1186211862
</div>
@@ -11964,7 +11964,7 @@ <h2 id="Anonymous-functions">Anonymous functions<a class="anchor-link" href="#An
1196411964

1196511965

1196611966
<div class="output_text output_subarea output_execute_result">
11967-
<pre>&lt;function __main__.&lt;lambda&gt;&gt;</pre>
11967+
<pre>&lt;function __main__.&lt;lambda&gt;(x)&gt;</pre>
1196811968
</div>
1196911969

1197011970
</div>
@@ -13452,11 +13452,11 @@ <h2 id="Speed">Speed<a class="anchor-link" href="#Speed">&#182;</a></h2><p>The f
1345213452

1345313453
<div class="output_subarea output_stream output_stdout output_text">
1345413454
<pre>N = 10000000
13455-
for-loop1: 3.883s
13456-
for-loop2: 3.221s
13457-
listcomp : 2.422s
13458-
numpy : 0.108s
13459-
Slowest method is 36.1 times slower than the fastest method.
13455+
for-loop1: 3.309s
13456+
for-loop2: 2.501s
13457+
listcomp : 2.322s
13458+
numpy : 0.083s
13459+
Slowest method is 39.7 times slower than the fastest method.
1346013460
</pre>
1346113461
</div>
1346213462
</div>
@@ -13508,7 +13508,7 @@ <h2 id="The-%%timeit-magic">The <code>%%timeit</code> magic<a class="anchor-link
1350813508

1350913509

1351013510
<div class="output_subarea output_stream output_stdout output_text">
13511-
<pre>27 µs ± 1.38 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
13511+
<pre>31.6 µs ± 2.82 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
1351213512
</pre>
1351313513
</div>
1351413514
</div>
@@ -13542,7 +13542,7 @@ <h2 id="The-%%timeit-magic">The <code>%%timeit</code> magic<a class="anchor-link
1354213542

1354313543

1354413544
<div class="output_subarea output_stream output_stdout output_text">
13545-
<pre>31.3 µs ± 3.76 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
13545+
<pre>36.1 µs ± 3.08 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
1354613546
</pre>
1354713547
</div>
1354813548
</div>

html/10-matlab-to-python.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11911,7 +11911,7 @@ <h3 id="The-if-then-statement">The if-then statement<a class="anchor-link" href=
1191111911
<div class="text_cell_render border-box-sizing rendered_html">
1191211912
<p>Python requires a colon (“:”) after every condition (i.e. at the of the lines starting with <code>if</code>, <code>elif</code>, <code>else</code>. Python requires the commands to be executed within each part of the if-then-else statement to be indented.</p>
1191311913
<h3 id="Indexing">Indexing<a class="anchor-link" href="#Indexing">&#182;</a></h3><p>Matlab’s indexing of matrices and vectors starts a 1 (similar to Fortran), whereas Python’s indexing starts at 0 (similar to C).</p>
11914-
<h3 id="Matrices">Matrices<a class="anchor-link" href="#Matrices">&#182;</a></h3><p>In Matlab, every object is a matrix. In Python, there is a specialised extension library called <code>numpy</code> (see Sec. [cha:numer-pyth-numpy]) which provides the <code>array</code> object which in turns provides the corresponding functionality. Similar to Matlab, the <code>numpy</code> object is actually based on binary libraries and execution there very fast.</p>
11914+
<h3 id="Matrices">Matrices<a class="anchor-link" href="#Matrices">&#182;</a></h3><p>In Matlab, every object is a matrix. In Python, there is a specialised extension library called <code>numpy</code> (see Sec. [cha:numer-pyth-numpy]) which provides the <code>array</code> object which in turns provides the corresponding functionality. Similar to Matlab, the <code>numpy</code> object is actually based on binary libraries and execution there very fast.</p>
1191511915
<p>There is a dedicated introduction to numpy for Matlab users available at <a href="https://docs.scipy.org/doc/numpy-dev/user/numpy-for-matlab-users.html">https://docs.scipy.org/doc/numpy-dev/user/numpy-for-matlab-users.html</a>.</p>
1191611916

1191711917
</div>

0 commit comments

Comments
 (0)