danielhogg / cbin

Presentation and sources for a Python/C workshop held on Feb 1, 2019 at McGill University.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Speed up your Python 30x!

This repository is for a Python workshop titled Speed up your Python 30x! that was held on Feb 1st, 2019 at McGill University. This was part of the Workshop Series on Atmospheric Data Science. The presentation is uploaded as 'Python30x.pdf'.

This workshop gives a brief tour of how to speed up Python code by using the C language.

Three ways to improve Python performance with C:

  1. Using packages that have efficient C bindings, such as:
    • numpy
    • netCDF4
    • scipy
  2. Compile C code into a binary that can be called by your Python script.
  3. Compile C code into a shared library, whose functions can be called from Python by use of the ctypes module.

About

Presentation and sources for a Python/C workshop held on Feb 1, 2019 at McGill University.

License:MIT License


Languages

Language:C 85.3%Language:Makefile 12.0%Language:C++ 2.6%