Skip to content

Commit 809e1e0

Browse files
committed
Typo (#24)
1 parent 5ce839b commit 809e1e0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

03-anatomy.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ fastest. By casting the array into a larger data type such as `np.float64`, we
5454
gained a 25% speed factor. But, by viewing the array as a byte array
5555
(`np.int8`), we gained a 50% factor. The reason for such speedup are to be
5656
found in the internal numpy machinery and the compiler optimization. This
57-
example illustrates the philosophy of numpy as we'll se in the next section
58-
below.
57+
simple example illustrates the philosophy of numpy as we'll se in the next
58+
section below.
5959

6060

6161
Memory layout
@@ -83,7 +83,7 @@ precisely what is needed when you define a new array:
8383
Z = np.arange(9).reshape(3,3).astype(np.int16)
8484
8585
Here, we know that Z itemsize is 2 bytes (`int16`), the shape is (3,3) and
86-
the number of dimensions is 2 (`len(shape)`).
86+
the number of dimensions is 2 (`len(Z.shape)`).
8787

8888
.. code:: pycon
8989

book.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ <h2><a class="toc-backref" href="#id2">Introduction</a></h2>
447447
gained a 25% speed factor. But, by viewing the array as a byte array
448448
(<code>np.int8</code>), we gained a 50% factor. The reason for such speedup are to be
449449
found in the internal numpy machinery and the compiler optimization. This
450-
example illustrates the philosophy of numpy as we'll se in the next section
451-
below.</p>
450+
simple example illustrates the philosophy of numpy as we'll se in the next
451+
section below.</p>
452452
</div>
453453
<div class="section" id="memory-layout">
454454
<h2><a class="toc-backref" href="#id2">Memory layout</a></h2>
@@ -468,7 +468,7 @@ <h2><a class="toc-backref" href="#id2">Memory layout</a></h2>
468468
<span class="name">Z</span> <span class="operator">=</span> <span class="name">np</span><span class="operator">.</span><span class="name">arange</span><span class="punctuation">(</span><span class="literal number integer">9</span><span class="punctuation">)</span><span class="operator">.</span><span class="name">reshape</span><span class="punctuation">(</span><span class="literal number integer">3</span><span class="punctuation">,</span><span class="literal number integer">3</span><span class="punctuation">)</span><span class="operator">.</span><span class="name">astype</span><span class="punctuation">(</span><span class="name">np</span><span class="operator">.</span><span class="name">int16</span><span class="punctuation">)</span>
469469
</pre>
470470
<p>Here, we know that Z itemsize is 2 bytes (<code>int16</code>), the shape is (3,3) and
471-
the number of dimensions is 2 (<code>len(shape)</code>).</p>
471+
the number of dimensions is 2 (<code>len(Z.shape)</code>).</p>
472472
<pre class="code pycon literal-block">
473473
<span class="keyword"></span><span class="generic prompt">&gt;&gt;&gt; </span><span class="keyword">print</span><span class="punctuation">(</span><span class="name">Z</span><span class="operator">.</span><span class="name">itemize</span><span class="punctuation">)</span>
474474
<span class="generic output">2

0 commit comments

Comments
 (0)