Skip to content

Commit d644c62

Browse files
committed
HTML build
1 parent 0b1523d commit d644c62

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

book.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ <h2 class="subtitle" id="copyright-c-2017-nicolas-p-rougier-nicolas-rougier-inri
3434
<img alt="data/cubes.png" src="data/cubes.png" style="width: 100%;" />
3535
</div>
3636
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
37-
<p>There is already a fair number of book about numpy (see <a class="reference internal" href="#bibliography">Bibliography</a>) and a
37+
<p>There is already a fair number of books about Numpy (see <a class="reference internal" href="#bibliography">Bibliography</a>) and a
3838
legitimate question is to wonder if another book is really necessary. As you
3939
may have guessed by reading these lines, my personal answer is yes, mostly
40-
because I think there's room for a different approach concentrating on the
41-
migration from Python to numpy through vectorization. There is a lot of
40+
because I think there is room for a different approach concentrating on the
41+
migration from Python to Numpy through vectorization. There are a lot of
4242
techniques that you don't find in books and such techniques are mostly learned
43-
through experience. The goal of this book is to explain some of them and to
44-
make you acquire experience in the process.</p>
43+
through experience. The goal of this book is to explain some of these
44+
techniques and to provide an opportunity for making this experience in the
45+
process.</p>
4546
<p><strong>Website:</strong> <a class="reference external" href="http://www.labri.fr/perso/nrougier/from-python-to-numpy">http://www.labri.fr/perso/nrougier/from-python-to-numpy</a></p>
4647
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
4748
<div class="contents main-content topic" id="table-of-contents">
@@ -330,7 +331,7 @@ <h2><a class="toc-backref" href="#table-of-contents">Simple example</a></h2>
330331
super simple. We just have to translate itertools call into numpy ones.</p>
331332
<pre class="code python literal-block">
332333
<span class="keyword">def</span> <span class="name function">random_walk_fastest</span><span class="punctuation">(</span><span class="name">n</span><span class="operator">=</span><span class="literal number integer">1000</span><span class="punctuation">):</span>
333-
<span class="name">steps</span> <span class="operator">=</span> <span class="literal number integer">2</span><span class="operator">*</span><span class="name">np</span><span class="operator">.</span><span class="name">random</span><span class="operator">.</span><span class="name">randint</span><span class="punctuation">(</span><span class="literal number integer">0</span><span class="punctuation">,</span> <span class="literal number integer">2</span><span class="punctuation">,</span> <span class="name">size</span><span class="operator">=</span><span class="literal number integer">1000</span><span class="punctuation">)</span> <span class="operator">-</span> <span class="literal number integer">1</span>
334+
<span class="name">steps</span> <span class="operator">=</span> <span class="literal number integer">2</span><span class="operator">*</span><span class="name">np</span><span class="operator">.</span><span class="name">random</span><span class="operator">.</span><span class="name">randint</span><span class="punctuation">(</span><span class="literal number integer">0</span><span class="punctuation">,</span> <span class="literal number integer">2</span><span class="punctuation">,</span> <span class="name">size</span><span class="operator">=</span><span class="name">n</span><span class="punctuation">)</span> <span class="operator">-</span> <span class="literal number integer">1</span>
334335
<span class="keyword">return</span> <span class="name">np</span><span class="operator">.</span><span class="name">cumsum</span><span class="punctuation">(</span><span class="name">steps</span><span class="punctuation">)</span>
335336

336337
<span class="name">walk</span> <span class="operator">=</span> <span class="name">random_walk_fastest</span><span class="punctuation">(</span><span class="literal number integer">1000</span><span class="punctuation">)</span>

0 commit comments

Comments
 (0)