Author: Maciej Fijalkowski <fij...@gmail.com> Branch: extradoc Changeset: r4108:a65e0376519b Date: 2012-02-29 12:55 -0800 http://bitbucket.org/pypy/extradoc/changeset/a65e0376519b/
Log: add numpy example diff --git a/talk/pycon2012/tutorial/examples.rst b/talk/pycon2012/tutorial/examples.rst --- a/talk/pycon2012/tutorial/examples.rst +++ b/talk/pycon2012/tutorial/examples.rst @@ -1,12 +1,20 @@ * Refcount example, where it won't work + 01_refcount + * A simple speedup example and show performance + 02_speedup + * Show memory consumption how it grows for tight instances + 03_memory + * Some numpy example (?) + 04_numpy + * An example how to use execnet * An example how to use matplotlib diff --git a/talk/pycon2012/tutorial/examples/04_numpy.py b/talk/pycon2012/tutorial/examples/04_numpy.py new file mode 100644 --- /dev/null +++ b/talk/pycon2012/tutorial/examples/04_numpy.py @@ -0,0 +1,15 @@ +try: + import numpypy +except ImportError: + pass +import numpy + +def f(): + a = numpy.zeros(10000, dtype=float) + b = numpy.zeros(10000, dtype=float) + c = numpy.zeros(10000, dtype=float) + (a + b)[0] = 3 + (a + b * c)[0] = 3 + (a + b * c).sum() + +f() _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit