Training Python Academy

Training goals dlearning

code: PA-HPCP

The requirement for extensive and challenging computations is far older than the computing industry. Today, software is a mere means to a specific end, it needs to be newly developed or adapted in countless places in order to achieve the special goals of the users and to run their specific calculations efficiently. Nothing is of more avail to this need than a programming language that is easy for users to learn and that enables them to actively follow and form the realisation of their requirements.

Python is this programming language. It is easy to learn, to use and to read. The language makes it easy to write maintainable code and to use it as a basis for communication with other people. Moreover, it makes it easy to optimise and specialise this code in order to use it for challenging and time critical computations. This is the main subject of this course.

Conspect Show list

  1. Optimizing Python programs
    • Guidelines for optimization.
    • Optimization strategies - Pystone benchmarking concept, CPU usage profiling with cProfile, memory measuring with Guppy_PE Framework. Participants are encouraged to bring their own programs for profiling to the course.
    • Algorithms and anti-patterns - examples of algorithms that are especially slow or fast in Python.
    • The right data structure - comparation of built-in data structures: lists, sets, deque and defaulddict - big-O notation will be exemplified.
    • Caching - deterministic and non-deterministic look on caching and developing decorates for these purposes.
    • The example - we will use a computionally demanding example and implement it first in pure Python. Then we look at some algorithmic improvements to speed up the computation.
    • Testing speed - solution to measuring how fast a program really run in Python.
    • Psyco - 'just-in-time-complier' (JIT), allowing to translate parts of the byte code to machine code. Example are used to show different possibilities of using Psyco.
    • Numerical calculations with Numpy - basic possibilities of NumPy covered.
    • Using multiple CPUS with Pyprocessing/multiprocessing.
    • Combination of optimization strategies.
    • Overwiew of extensions to Python with other languages.
  2. Python Extensions with Other Languages
    • Introduction to example that will be used in further part of that module.
    • Use of Python's C-API - Standard Python is implemented in C and offers a comprehensive API for writing extensions. The basics of this API are taught.
    • Python extensions with Pyrex/Cython.
    • Use of DLLs with ctypes - package ctypes allows to acces DLLs or shared libraries from Python.
    • Automatic generation of extensions with SWIG - The "Simplified Wrapper and Interface Generator" allows to make C/C++ libraries accesible from 13 different languages - one of them is Python. Examples in C as well as in C++ are provided.
    • Jython - basics of Python in Java implementation. Examples for use of existing Java classes as well as self writen classes.
    • IronPython - implementation of Python in .NET allowing access to all .NET features and making it a first class .NET language right next to C# and Visual Basic.
    • Use of FORTRAN subroutines from Python - example of usage F2PY to connect FORTRAN77 as well as FORTRAN90/95 programs with Python. Object-oriented interfaces to FORTRAN libraries.
  3. Fast Code with the Cython Compiler
    • Using pyximport to quickly (re-)build extension modules.
    • Using cython.inline() to compile code at runtime.
    • Building extension modules with distutils.
    • Fast access to Python's builtin types.
    • Fast looping over Python iterables and C types.
    • String processing.
    • Fast arithmetic.
    • Incrementally optimizing Cython code.
    • Multi-threading outsife od the GIL(Global Interpreter Lock).
    • Calling into external C libraries.
    • Building against C libraries.
    • Writing Python wrapper APIs.
    • Calling C functions across extension module boundaries.
  4. Numerical calculations with NumPy
    • Standard arrays and linear algebra library
    • Array-constructions and array-properties in examples
    • Speed comparison between dynamically determined Python data types with explicitly specified NumPy arrays
    • Correspondence between NumPy and C data types
    • Slicing and Broadcasting - reading and writing to arbitrary parts of arrays, applying broadcasting for arrays with different shapes.
    • Universal Functions - applying many operations on whole arrays independent from their dimensions, use examples.
    • Numerical algebra.
    • Working with missing values - masked and NA-masked arrays to handle arrays with missing or not valid values.
    • Customizing error handling - NumPy offers a fine-grained approach to handle errors without impacting the performance.
    • Testing support - NumPy includes helpers to write to test code - course introduces to testing basics with it.
  5. Fast NumPy Processing with Cython
    • Use of Python's buffer interface from Cython code.
    • Directly accessing data buffers of other Python extensions.
    • Retrieving meta data about the buffer layout.
    • Setting up efficient memory views on external buffers.
    • Implementing fast Cython loops over NumPy arrays.
    • Implementing a simple image processing algorithm
    • Looping over NumPy exported buffers.
    • Using "fused types" (simple templating) to implement an algorithm once and run it efficiently on different C data types.
    • Use of parallel loops to make use of multiple processing cores.
    • Building modules with OpenMP.
    • Processing data in parallel.
    • Speeding up an existing loop using OpenMP threads.
Download conspect training as PDF

Additional information

  • Having experience in Python programming.
  • Basic understanding of C language is helpful - but not required.
Difficulty level
Duration 5 days

The participants will obtain certificates signed by Python Academy.


Authorized Python Academy Trainer.

Other training Python Academy | On Demand

Training thematically related



Contact form

Please fill form below to obtain more info about this training.

* Fields marked with (*) are required !!!

Information on data processing by Compendium - Centrum Edukacyjne Spółka z o.o.

1500 EUR


Discount codes

Discount code may refer to (training, producer, deadline). If you have a discount code, enter it in the appropriate field.
(green means entering the correct code | red means the code is incorrect)



Traditional training

Sessions organised at Compendium CE are usually held in our locations in Kraków and Warsaw, but also in venues designated by the client. The group participating in training meets at a specific place and specific time with a coach and actively participates in laboratory sessions.

Dlearning training

You may participate from at any place in the world. It is sufficient to have a computer (or, actually a tablet, or smartphone) connected to the Internet. Compendium CE provides each Distance Learning training participant with adequate software enabling connection to the Data Center. For more information, please visit site



Paper materials

Traditional Materials: The price includes standard materials issued in the form of paper books, printed or other, depending on the arrangements with the manufacturer.

Ctab materials

Ctab materials: the price includes ctab tablet and electronic training materials or traditional training materials and supplies provided electronically according to manufacturer's specifications (in PDF or EPUB form). The materials provided are adapted for display on ctab tablets. For more information, check out the ctab website.



No deadlines for this training.

Suggest your own appointment

Upcoming Python Academy training

Training schedule
Python Academy