Cython: Speed up Python and NumPy, Pythonize C, C++, and Fortran, SciPy2013 Tutorial, Part 1 of 4

Enthought · 39K views · 2013 · 1:11:32

Open on YouTube

Python, Ruby & scripting languagesSoftware performance & optimizationC, C++, Rust, Go & systems languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as a starting point when they need to learn Cython for scientific code or for wrapping C libraries.

Recommended by 3 people across 3 different months, 2013 to 2015.

What it is

Part 1 of a four-part SciPy 2013 hands-on tutorial by Kurt Smith on Cython, covering how to add type information to Python code for speed and how to wrap C, C++ and Fortran libraries for use with Python and NumPy. It starts from the ground up and includes newer features such as typed memoryviews.

What people said

Recommends Nafiul Islam · 2013-10 · Stack Overflow · on “Boost.python vs Cython for C++/python interface”

Considering my application, which mainly is a scientific That pretty much means Cython. Cython was made almost specifically for that very purpose. There is a video [this video] on getting started with on from Enthought. Enthought is a company that specializes in scientific calculations. Cython has a very good integration with Python that is unmatched by C++ or C (you would have to use #include <Python.h> ).

Recommends Robert Ekendahl · 2014-07 · Stack Overflow · on “wrapping a C library (GSL) in a cython code by using callback”

I found that it was worth my time to watch this video lecture [this video] . That is how I just got started. I see nothing in your code that cannot be converted (at a first) glance. Start by trying to convert the `.h` classes and structs into cython classes. Some pointers can be found on the cython website [LINK] . But it will all make more sense if you look at the presentation first!

Recommends Padraic Cunningham · 2014-12 · Stack Overflow · on “Using Python list in a C extension”

@GrayFall9, cython is incredibly easy to use. I found this series of video from scipy 2013 very helpful [this video]

Cites user27886 · 2015-03 · Stack Overflow · on “Cython basic build still failing”

I am using python 2.7.6 and am on Windows 7 x64 Here is the entry point display for my python: >python Python 2.7.6 [MSC v.1800 32 bit (Intel)] on win32 So I am using all 32bit binaries. I am trying to compile the fibonacci demo/tutorial from the 2013 Sci Py talk on using Cython showing here [this video] . You can download the tutorial files here [LINK] ( unpack the tutorial files and go into ~/demo/fib/ ). I have installed Cython using pip install cython which is a success. I tried to compile the python .pyx using >python setup.py build_ext --inplace --compilers=mingw32 running build_ext Traceback (most recent call last): File "setup.py", line 17, in <module> ext_modules = exts, File "~\Python\L