Book Image

Learning IPython for Interactive Computing and Data Visualization

By : Cyrille Rossant
Book Image

Learning IPython for Interactive Computing and Data Visualization

By: Cyrille Rossant

Overview of this book

<p>You already use Python as a scripting language, but did you know it is also increasingly used for scientific computing and data analysis? Interactive programming is essential in such exploratory tasks and IPython is the perfect tool for that. Once you’ve learnt it, you won’t be able to live without it.<br /><br />"Learning IPython for Interactive Computing and Data Visualization" is a practical, hands-on, example-driven tutorial to considerably improve your productivity during interactive Python sessions, and shows you how to effectively use IPython for interactive computing and data analysis.<br /><br />This book covers all aspects of IPython, from the highly powerful interactive Python console to the numerical and visualization features that are commonly associated with IPython.</p> <p>You will learn how IPython lets you perform efficient vectorized computations, through examples covering numerical simulations with NumPy, data analysis with Pandas, and visualization with Matplotlib. You will also discover how IPython can be conveniently used to optimize your code using parallel computing and dynamic compilation in C with Cython.</p> <p>"Learning IPython for Interactive Computing and Data Visualization" will allow you to optimize your productivity in interactive Python sessions.</p>
Table of Contents (13 chapters)

Embedding IPython


It is possible to launch IPython from any Python script, even when the standard Python interpreter runs the script. It can be useful in some occasions when you need to interact with a complex Python program at some point, and where using the IPython interpreter for the whole program is not possible or unwanted. For example, in a scientific computing context, you may want to pause the program after some automatic, computationally-intensive algorithms to look at the data, draw some plots, and so on, before resuming the program. Another possible use case is the integration of a widget in a graphical user interface to let the user interact with the Python environment through the IPython command-line interface.

The easiest way to integrate IPython in a program is to call IPython.embed() at any point in your Python program (after import IPython). You can also specify custom options, including the input/output templates in the command-line interface, the startup/exit messages,...