Learning IPython for Interactive Computing and Data Visualization
eBook - ePub

Learning IPython for Interactive Computing and Data Visualization

  1. 138 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning IPython for Interactive Computing and Data Visualization

About this book

In Detail

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.

"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.

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.

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.

"Learning IPython for Interactive Computing and Data Visualization" will allow you to optimize your productivity in interactive Python sessions.

Approach

A practical hands-on guide which focuses on interactive programming, numerical computing, and data analysis with IPython.

Who this book is for

This book is for Python developers who use Python as a scripting language or for software development, and are interested in learning IPython for increasing their productivity during interactive sessions in the console. Knowledge of Python is required, whereas no knowledge of IPython is necessary.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Learning IPython for Interactive Computing and Data Visualization by Cyrille Rossant in PDF and/or ePUB format, as well as other popular books in Informatica & Informatica generale. We have over one million books available in our catalogue for you to explore.

Information

Learning IPython for Interactive Computing and Data Visualization


Table of Contents

Learning IPython for Interactive Computing and Data Visualization
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with IPython
Installing IPython and the recommended packages
Prerequisites for IPython
Installing an all-in-one distribution
Installing the packages one by one
Packages websites
Getting binary installers
Windows
OS X
Linux
Table of binary packages
Using the Python packaging system
Optional dependencies for IPython
Installing the development versions
Ten IPython essentials
Running the IPython console
Using IPython as a system shell
Using the history
Tab completion
Executing a script with the %run command
Quick benchmarking with the %timeit command
Quick debugging with the %debug command
Interactive computing with Pylab
Using the IPython Notebook
Customizing IPython
Summary
2. Interactive Work with IPython
The extended shell
Navigating through the filesystem
Accessing the system shell from IPython
The extended Python console
Exploring the history
Import/export of Python code
Importing code in IPython
Exporting code to a file
Dynamic introspection
Tab completion
An example of tab completion NetworkX
Tab completion with custom classes
Source code introspection
Using the interactive debugger
Interactive benchmarking and profiling
Controlling the execution time of a command
Profiling a script
Using the IPython notebook
Installation
The notebook dashboard
Working with cells
Cell magics
Managing notebooks
Multimedia and rich text editing
Graph plotting
Summary
3. Numerical Computing with IPython
A primer to vector computing
An example of computation with Python loops
What an array is
Reimplementing the example with arrays
Creating and loading arrays
Creating arrays
From scratch, element by element
From scratch, using predefined templates
From random values
Loading arrays
From a native Python object
From a buffer or an external file
Using Pandas
Working with arrays
Selection
Using Pandas
Using NumPy
More indexing possibilities
Manipulation
Reshaping
Repeating and concatenating
Broadcasting
Permuting
Computation
Advanced mathematical processing
Summary
4. Interactive Plotting and Graphical Interfaces
Figures with Matplotlib
Setting up IPython for interactive visualization
Using Matplotlib
Interactive navigation
Matplotlib in the IPython notebook
Standard plots
Curves
Scatter plots
Bar graphs
Plot customization
Styles and colors
Grid, axes, and legends
Interaction from IPython
Drawing multiple plots
Advanced figures and graphics
Image processing
Loading images
Showing images
Using PIL
Advanced image processing – color quantization
Maps
3D plots
Animations
Other visualization packages
Graphical User Interfaces (GUI)
Setting up IPython for interactive GUIs
A "Hello World" example
Summary
5. High-Performance and Parallel Computing
Interactive task parallelization
Parallel computing in Python
Distributing tasks on multiple cores
Starting the engines
Creating a Client instance
Using the parallel magic
Parallel map
Creating a view
Synchronous map
Asynchronous map
A practical example – Monte Carlo simulations
Using MPI with IPython
Advanced parallel computing features of IPython
Using C in IPython with Cython
Installing and configuring Cython
Using Cython from IPython
Accelerating a pure Python algorithm with Cython
Pure Python version
Naïve Cython conversion
Adding C types
Using NumPy and Cython
Python version
Cython version
More advanced options for accelerating Python code
Summary
6. Customizing IPython
IPython profiles
Profile locations
The IPython configuration files
Loading scripts when IPython starts
IPython extensions
Example – line-by-line profiling
Creating new extensions
Example – executing C++ code in IPython
Rich representations in the frontend
Embedding IPython
Final words
Summary
Index

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. H...

Table of contents

  1. Learning IPython for Interactive Computing and Data Visualization