Learning IPython for Interactive Computing and Data Visualization
Copyright 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2013
Production Reference: 1150413
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78216-993-2
www.packtpub.com
Cover Image by Asher Wishkerman (<>
)
Credits
Author
Cyrille Rossant
Reviewers
Francisco J. Blanco-Silva
Matthias Bussonnier
Acquisition Editor
Kartikey Pandey
Comissioning Editor
Maria D'souza
Sruthi Kutty
Technical Editors
Soumya Kanti
Veena Pagare
Copy Editor
Insiya Morbiwala
Alfida Paiva
Project Coordinator
Sneha Modi
Proofreader
Lauren Tobon
Indexer
Rekha Nair
Graphics
Aditi Gajjar
Ronak Shah
Production Coordinator
Nilesh R. Mohite
Cover Work
Nilesh R. Mohite
About the Author
Cyrille Rossant is a French researcher in quantitative neuroscience. A graduate of the Ecole Normale Suprieure, Paris, he holds a Master's degree and a Ph.D. in Mathematics and Computer Science. He uses IPython every day to model and simulate the brain and to analyze experimental data. He is the creator of a few scientific Python packages, including Playdoh (parallel computing) and Galry (high-performance interactive visualization).
I am grateful to the vibrant Python community for developing this great open platform for computational science. Devoting hard work to open-source software sometimes requires personal sacrifice, but it's worth the effort. In particular, I would like to thank Fernando Perez, creator of IPython, and all the development team for their awesome work on this library. Also, we regular Matplotlib users are all deeply grateful to its creator John Hunter, whose untimely passing in 2012 is a tragedy for the whole community and beyond.
I would also like to thank the reviewers for their helpful comments and suggestions. Finally, I am grateful to my family and Claire for their support during the writing of this book.
About the Reviewer
Matthias Bussonnier is a young French physicist working in biophysics. He has been a core developer of IPython since 2011.
I'd like to thank all my family, colleagues, as well as the IPython core team for their help and the fun moments spent developing for the open source community.
Dr. Francisco J. Blanco-Silva , the owner of a scientific consulting companyTizona Scientific Solutionsand adjunct faculty in the Department of Mathematics of the University of South Carolina has obtained his formal training as an applied mathematician at Purdue University. He enjoys problem solving, learning, and teaching. An avid programmer and blogger, when it comes to writing he relishes finding that common denominator among his passions and skills, and making it available to everyone.
He has written the technical book Learning SciPy for Numerical and Scientific Computing, Packt Publishing .
He has also co-authored Chapter 5 of the book Modeling Nanoscale Imaging in Electron Microscopy, Springer 201, Thomas Vogt and Wolfgang Dahmen, Springer .
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at > for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
- Fully searchable across every book published by Packt
- Copy and paste, print and bookmark content
- On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Preface
You are a programmer using Python as a scripting language, maybe for software development. Learning IPython will let you use Python interactively in a highly efficient way, for example, when exploring algorithms or analyzing data. In addition, it is the best way to be introduced to the most advanced capabilities of the platform, namely numerical computing, interactive visualization, and parallel programming.
What this book covers
, Getting Started with IPython , is a short, hands-on introduction to the key features of IPython. It will give you a broad overview of what IPython offers. All features introduced in this chapter will be covered in the subsequent chapters.
, Interactive Work with IPython , will show you how to use Python interactively from the IPython command-line interface, and how the numerous magic commands will help you considerably improve your productivity. This chapter will also introduce you to the IPython notebook, a modern tool for reproducible and collaborative interactive programming.
, Numerical Computing with IPython , contains an introduction to the numerical computing features of Numpy and Pandas, which can be conveniently used from IPython. These tools are essential as soon as you need to analyze large amounts of data, or more generally when you need to perform efficient numerical computations.
, Interactive Plotting and Graphical Interfaces , covers the graphical capabilities of Matplotlib, and shows how they integrate smoothly in IPython. Matplotlib is a very powerful graphical library, which allows you to either generate high-quality figures or to visualize data interactively.
, High-Performance and Parallel Computing