Skip to content

Commit 993b8de

Browse files
committed
HTML build
1 parent 13d950e commit 993b8de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

book.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ <h2><a class="toc-backref" href="#table-of-contents">Simple example</a></h2>
325325
<span class="generic prompt">&gt;&gt;&gt; </span><span class="name">timeit</span><span class="punctuation">(</span><span class="literal string double">&quot;random_walk_faster(n=10000)]&quot;</span><span class="punctuation">,</span> <span class="name builtin">globals</span><span class="punctuation">())</span>
326326
<span class="generic output">10 loops, best of 3: 8.21 msec per loop</span>
327327
</pre>
328-
<p>We gained 50% of computation-time compared to the previous version which is
329-
already good, but this new version makes numpy vectorization super simple, we
330-
just have to translate it into numpy methods.</p>
328+
<p>We gained 50% of computation-time compared to the previous version, not so
329+
bad. But the advantage of this new version is that it makes numpy vectorization
330+
super simple. We just have to translate itertools call into numpy ones.</p>
331331
<pre class="code python literal-block">
332332
<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>
333333
<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>

0 commit comments

Comments
 (0)