EuroPython 2016

NumPy with Cython

Speaker(s) Stefan Behnel

The Cython compiler is an excellent and widely used tool for speeding up computational code and talking to native libraries. It translates Python code to C or C++ code and supports static type annotations to allow direct use of C/C++ data types, native functions and complex array types. The tight integration of all three languages makes it possible to freely mix Python features like generators and comprehensions with C/C++ features like native data types, pointer arithmetic or manually tuned memory management in the same code. Cython has direct support for NumPy arrays and other buffer objects, which allows for efficient and even parallel (OpenMP) processing of large arrays.

This tutorial by a Cython core developer introduces the Cython programming language and its compiler and leads the participants all the way from their first Python extension to an efficient integration with NumPy arrays.

Note that participants are expected to have a good understanding of the Python language, at least some basic knowledge about NumPy and C or C++, and are able to use a C compiler on their computers to build native CPython modules from sources (e.g. install source packages from PyPI that contain C extensions). No deep C programming knowledge is required, nor is any prior knowledge needed about writing extension modules for the CPython runtime. The Cython compiler handles most of these low-level issues itself.

in on Wednesday 20 July at 14:00 See schedule

Do you have some questions on this talk?

New comment