Home

Awesome

UPDATE (2015): This is an old repo, go here for the new edition

Examples from the IPython mini-book

This repository contains all code examples from the book Learning IPython for Interactive Computing and Data Visualization, Packt Publishing, by Cyrille Rossant.

Book overview

This book is a beginner-level introduction to IPython for interactive Python programming, high-performance numerical computing, and data visualization. It assumes nothing more than familiarity with Python. It targets developers, students, teachers, hobbyists who know Python a bit, and who want to learn IPython for the extended console, the Notebook, and for more advanced scientific applications.

The book first introduces IPython for interactive Python and shell programming. It shows how IPython can considerably improve the productivity of a developer who creates, debugs, benchmarks and profiles Python code.

Then, the reader learns the very basics of vector computing, and discovers how to load and analyze numerical and tabular data with NumPy and Pandas. The book shows the interactive visualization capabilities of the platform with Matplotlib, SciPy and PIL. It also contains a few image processing examples.

Some techniques to accelerate Python code are also demonstrated, using either interactive parallel computing features from IPython (using MPI or not), or Cython to compile a portion of the code in C for really interesting speedups.

Finally, the book shows how IPython can be customized for advanced uses, notably with the creation of new extensions and magic commands.

Code examples

Most files are IPython notebooks (.ipynb extension with JSON data). There are also some Python external scripts (.py extension).

The following modules are used in at least one example:

You can view the notebooks in the IPython notebook viewer (see links below).

Chapter 2: Interactive Work with IPython

Chapter 3: Numerical Computing with IPython

Chapter 4: Interactive Plotting and Graphical Interfaces

Chapter 5: High Performance and Parallel Computing

Chapter 6: Customizing IPython