Skip to content

Commit e2052f8

Browse files
committed
Added link to matplotlib tutorial
1 parent 54cd679 commit e2052f8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

01-preface.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ visualization (OpenGL). Nicolas P. Rougier is the author of several online
2525
resources and tutorials (Matplotlib, numpy, OpenGL) and he's teaching Python,
2626
numpy and scientific visualization at the University of Bordeaux and in various
2727
conferences and schools worldwide (SciPy, EuroScipy, etc). He's also the author
28-
of the popular article `Ten Simple Rules for Better Figures`_.
28+
of the popular article `Ten Simple Rules for Better Figures`_ and a popular
29+
'matplotlib tutorial
30+
<http://www.labri.fr/perso/nrougier/teaching/matplotlib/matplotlib.html>`_.
2931

3032

3133
About this book

02-introduction.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ function as:
8787
steps = random.sample([1, -1]*n, n)
8888
return list(accumulate(steps))
8989
90+
walk = random_walk_faster(1000)
91+
9092
In fact, we've just *vectorized* our function. Instead of looping for picking
9193
sequential steps and add them to the current position, we fist generate all the
9294
steps at once and use the `accumulate
@@ -110,6 +112,8 @@ just have to translate it into numpy methods.
110112
steps = 2*np.random.randint(0, 2, size=1000) - 1
111113
return np.cumsum(steps)
112114
115+
walk = random_walk_fastest(1000)
116+
113117
Not too difficult, but we gained a factor 500x using numpy:
114118

115119
.. code:: pycon

0 commit comments

Comments
 (0)