IPython Interactive Computing and Visualization Cookbook - Second Edition

Learn to use IPython and Jupyter Notebook for your data analysis and visualization work.
Preview in Mapt

IPython Interactive Computing and Visualization Cookbook - Second Edition

Cyrille Rossant

Learn to use IPython and Jupyter Notebook for your data analysis and visualization work.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$14.00
RRP $27.99
Save 49%
Print + eBook
$34.99
RRP $34.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$14.00
$34.99
$29.99 p/m after trial
RRP $27.99
RRP $34.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


IPython Interactive Computing and Visualization Cookbook - Second Edition Book Cover
IPython Interactive Computing and Visualization Cookbook - Second Edition
$ 27.99
$ 14.00
Python Web Scraping Cookbook Book Cover
Python Web Scraping Cookbook
$ 31.99
$ 16.00
Buy 2 for $30.00
Save $29.98
Add to Cart

Book Details

ISBN 139781785888632
Paperback548 pages

Book Description

Python is one of the leading open source platforms for data science and numerical computing. IPython and the associated Jupyter Notebook offer efficient interfaces to Python for data analysis and interactive visualization, and they constitute an ideal gateway to the platform.

IPython Interactive Computing and Visualization Cookbook, Second Edition contains many ready-to-use, focused recipes for high-performance scientific computing and data analysis, from the latest IPython/Jupyter features to the most advanced tricks, to help you write better and faster code. You will apply these state-of-the-art methods to various real-world examples, illustrating topics in applied mathematics, scientific modeling, and machine learning.

The first part of the book covers programming techniques: code quality and reproducibility, code optimization, high-performance computing through just-in-time compilation, parallel computing, and graphics card programming. The second part tackles data science, statistics, machine learning, signal and image processing, dynamical systems, and pure and applied mathematics.

Table of Contents

Chapter 1: A Tour of Interactive Computing with Jupyter and IPython
Introduction
Introducing IPython and the Jupyter Notebook
Getting started with exploratory data analysis in the Jupyter Notebook
Introducing the multidimensional array in NumPy for fast array computations
Creating an IPython extension with custom magic commands
Mastering IPython's configuration system
Creating a simple kernel for Jupyter
Chapter 2: Best Practices in Interactive Computing
Introduction
Learning the basics of the Unix shell
Using the latest features of Python 3
Learning the basics of the distributed version control system Git
A typical workflow with Git branching
Efficient interactive computing workflows with IPython
Ten tips for conducting reproducible interactive computing experiments
Writing high-quality Python code
Writing unit tests with pytest
Debugging code with IPython
Chapter 3: Mastering the Jupyter Notebook
Introduction
Teaching programming in the Notebook with IPython Blocks
Converting a Jupyter notebook to other formats with nbconvert
Mastering widgets in the Jupyter Notebook
Creating custom Jupyter Notebook widgets in Python, HTML, and JavaScript
Configuring the Jupyter Notebook
Introducing JupyterLab
Chapter 4: Profiling and Optimization
Introduction
Evaluating the time taken by a command in IPython
Profiling your code easily with cProfile and IPython
Profiling your code line-by-line with line_profiler
Profiling the memory usage of your code with memory_profiler
Understanding the internals of NumPy to avoid unnecessary array copying
Using stride tricks with NumPy
Implementing an efficient rolling average algorithm with stride tricks
Processing large NumPy arrays with memory mapping
Manipulating large arrays with HDF5
Chapter 5: High-Performance Computing
Introduction
Using Python to write faster code
Accelerating pure Python code with Numba and Just-In-Time compilation
Accelerating array computations with NumExpr
Wrapping a C library in Python with ctypes
Accelerating Python code with Cython
Optimizing Cython code by writing less Python and more C
Releasing the GIL to take advantage of multi-core processors with Cython and OpenMP
Writing massively parallel code for NVIDIA graphics cards (GPUs) with CUDA
Distributing Python code across multiple cores with IPython
Interacting with asynchronous parallel tasks in IPython
Performing out-of-core computations on large arrays with Dask
Trying the Julia programming language in the Jupyter Notebook
Chapter 6: Data Visualization
Introduction
Using Matplotlib styles
Creating statistical plots easily with seaborn
Creating interactive web visualizations with Bokeh and HoloViews
Visualizing a NetworkX graph in the Notebook with D3.js
Discovering interactive visualization libraries in the Notebook
Creating plots with Altair and the Vega-Lite specification
Chapter 7: Statistical Data Analysis
Introduction
Exploring a dataset with pandas and Matplotlib
Getting started with statistical hypothesis testing — a simple z-test
Getting started with Bayesian methods
Estimating the correlation between two variables with a contingency table and a chi-squared test
Fitting a probability distribution to data with the maximum likelihood method
Estimating a probability distribution nonparametrically with a kernel density estimation
Fitting a Bayesian model by sampling from a posterior distribution with a Markov chain Monte Carlo method
Analyzing data with the R programming language in the Jupyter Notebook
Chapter 8: Machine Learning
Introduction
Getting started with scikit-learn
Predicting who will survive on the Titanic with logistic regression
Learning to recognize handwritten digits with a K-nearest neighbors classifier
Learning from text – Naive Bayes for Natural Language Processing
Using support vector machines for classification tasks
Using a random forest to select important features for regression
Reducing the dimensionality of a dataset with a principal component analysis
Detecting hidden structures in a dataset with clustering
Chapter 9: Numerical Optimization
Introduction
Finding the root of a mathematical function
Minimizing a mathematical function
Fitting a function to data with nonlinear least squares
Finding the equilibrium state of a physical system by minimizing its potential energy
Chapter 10: Signal Processing
Introduction
Analyzing the frequency components of a signal with a Fast Fourier Transform
Applying a linear filter to a digital signal
Computing the autocorrelation of a time series
Chapter 11: Image and Audio Processing
Introduction
Manipulating the exposure of an image
Applying filters on an image
Segmenting an image
Finding points of interest in an image
Detecting faces in an image with OpenCV
Applying digital filters to speech sounds
Creating a sound synthesizer in the Notebook
Chapter 12: Deterministic Dynamical Systems
Introduction
Plotting the bifurcation diagram of a chaotic dynamical system
Simulating an elementary cellular automaton
Simulating an ordinary differential equation with SciPy
Simulating a partial differential equation — reaction-diffusion systems and Turing patterns
Chapter 13: Stochastic Dynamical Systems
Introduction
Simulating a discrete-time Markov chain
Simulating a Poisson process
Simulating a Brownian motion
Simulating a stochastic differential equation
Chapter 14: Graphs, Geometry, and Geographic Information Systems
Introduction
Manipulating and visualizing graphs with NetworkX
Drawing flight routes with NetworkX
Resolving dependencies in a directed acyclic graph with a topological sort
Computing connected components in an image
Computing the Voronoi diagram of a set of points
Manipulating geospatial data with Cartopy
Creating a route planner for a road network
Chapter 15: Symbolic and Numerical Mathematics
Introduction
Diving into symbolic computing with SymPy
Solving equations and inequalities
Analyzing real-valued functions
Computing exact probabilities and manipulating random variables
A bit of number theory with SymPy
Finding a Boolean propositional formula from a truth table
Analyzing a nonlinear differential system — Lotka-Volterra (predator-prey) equations
Getting started with Sage

What You Will Learn

  • Master all features of the Jupyter Notebook 
  • Code better: write high-quality, readable, and well-tested programs; profile and optimize your code; and conduct reproducible interactive computing experiments
  • Visualize data and create interactive plots in the Jupyter Notebook
  • Write blazingly fast Python programs with NumPy, ctypes, Numba, Cython, OpenMP, GPU programming (CUDA), parallel IPython, Dask, and more
  • Analyze data with Bayesian or frequentist statistics (Pandas, PyMC, and R), and learn from actual data through machine learning (scikit-learn)
  • Gain valuable insights into signals, images, and sounds with SciPy, scikit-image, and OpenCV
  • Simulate deterministic and stochastic dynamical systems in Python
  • Familiarize yourself with math in Python using SymPy and Sage: algebra, analysis, logic, graphs, geometry, and probability theory

Authors

Table of Contents

Chapter 1: A Tour of Interactive Computing with Jupyter and IPython
Introduction
Introducing IPython and the Jupyter Notebook
Getting started with exploratory data analysis in the Jupyter Notebook
Introducing the multidimensional array in NumPy for fast array computations
Creating an IPython extension with custom magic commands
Mastering IPython's configuration system
Creating a simple kernel for Jupyter
Chapter 2: Best Practices in Interactive Computing
Introduction
Learning the basics of the Unix shell
Using the latest features of Python 3
Learning the basics of the distributed version control system Git
A typical workflow with Git branching
Efficient interactive computing workflows with IPython
Ten tips for conducting reproducible interactive computing experiments
Writing high-quality Python code
Writing unit tests with pytest
Debugging code with IPython
Chapter 3: Mastering the Jupyter Notebook
Introduction
Teaching programming in the Notebook with IPython Blocks
Converting a Jupyter notebook to other formats with nbconvert
Mastering widgets in the Jupyter Notebook
Creating custom Jupyter Notebook widgets in Python, HTML, and JavaScript
Configuring the Jupyter Notebook
Introducing JupyterLab
Chapter 4: Profiling and Optimization
Introduction
Evaluating the time taken by a command in IPython
Profiling your code easily with cProfile and IPython
Profiling your code line-by-line with line_profiler
Profiling the memory usage of your code with memory_profiler
Understanding the internals of NumPy to avoid unnecessary array copying
Using stride tricks with NumPy
Implementing an efficient rolling average algorithm with stride tricks
Processing large NumPy arrays with memory mapping
Manipulating large arrays with HDF5
Chapter 5: High-Performance Computing
Introduction
Using Python to write faster code
Accelerating pure Python code with Numba and Just-In-Time compilation
Accelerating array computations with NumExpr
Wrapping a C library in Python with ctypes
Accelerating Python code with Cython
Optimizing Cython code by writing less Python and more C
Releasing the GIL to take advantage of multi-core processors with Cython and OpenMP
Writing massively parallel code for NVIDIA graphics cards (GPUs) with CUDA
Distributing Python code across multiple cores with IPython
Interacting with asynchronous parallel tasks in IPython
Performing out-of-core computations on large arrays with Dask
Trying the Julia programming language in the Jupyter Notebook
Chapter 6: Data Visualization
Introduction
Using Matplotlib styles
Creating statistical plots easily with seaborn
Creating interactive web visualizations with Bokeh and HoloViews
Visualizing a NetworkX graph in the Notebook with D3.js
Discovering interactive visualization libraries in the Notebook
Creating plots with Altair and the Vega-Lite specification
Chapter 7: Statistical Data Analysis
Introduction
Exploring a dataset with pandas and Matplotlib
Getting started with statistical hypothesis testing — a simple z-test
Getting started with Bayesian methods
Estimating the correlation between two variables with a contingency table and a chi-squared test
Fitting a probability distribution to data with the maximum likelihood method
Estimating a probability distribution nonparametrically with a kernel density estimation
Fitting a Bayesian model by sampling from a posterior distribution with a Markov chain Monte Carlo method
Analyzing data with the R programming language in the Jupyter Notebook
Chapter 8: Machine Learning
Introduction
Getting started with scikit-learn
Predicting who will survive on the Titanic with logistic regression
Learning to recognize handwritten digits with a K-nearest neighbors classifier
Learning from text – Naive Bayes for Natural Language Processing
Using support vector machines for classification tasks
Using a random forest to select important features for regression
Reducing the dimensionality of a dataset with a principal component analysis
Detecting hidden structures in a dataset with clustering
Chapter 9: Numerical Optimization
Introduction
Finding the root of a mathematical function
Minimizing a mathematical function
Fitting a function to data with nonlinear least squares
Finding the equilibrium state of a physical system by minimizing its potential energy
Chapter 10: Signal Processing
Introduction
Analyzing the frequency components of a signal with a Fast Fourier Transform
Applying a linear filter to a digital signal
Computing the autocorrelation of a time series
Chapter 11: Image and Audio Processing
Introduction
Manipulating the exposure of an image
Applying filters on an image
Segmenting an image
Finding points of interest in an image
Detecting faces in an image with OpenCV
Applying digital filters to speech sounds
Creating a sound synthesizer in the Notebook
Chapter 12: Deterministic Dynamical Systems
Introduction
Plotting the bifurcation diagram of a chaotic dynamical system
Simulating an elementary cellular automaton
Simulating an ordinary differential equation with SciPy
Simulating a partial differential equation — reaction-diffusion systems and Turing patterns
Chapter 13: Stochastic Dynamical Systems
Introduction
Simulating a discrete-time Markov chain
Simulating a Poisson process
Simulating a Brownian motion
Simulating a stochastic differential equation
Chapter 14: Graphs, Geometry, and Geographic Information Systems
Introduction
Manipulating and visualizing graphs with NetworkX
Drawing flight routes with NetworkX
Resolving dependencies in a directed acyclic graph with a topological sort
Computing connected components in an image
Computing the Voronoi diagram of a set of points
Manipulating geospatial data with Cartopy
Creating a route planner for a road network
Chapter 15: Symbolic and Numerical Mathematics
Introduction
Diving into symbolic computing with SymPy
Solving equations and inequalities
Analyzing real-valued functions
Computing exact probabilities and manipulating random variables
A bit of number theory with SymPy
Finding a Boolean propositional formula from a truth table
Analyzing a nonlinear differential system — Lotka-Volterra (predator-prey) equations
Getting started with Sage

Book Details

ISBN 139781785888632
Paperback548 pages
Read More

Read More Reviews

Recommended for You

Python Web Scraping Cookbook Book Cover
Python Web Scraping Cookbook
$ 31.99
$ 16.00
Python Deep Learning Cookbook Book Cover
Python Deep Learning Cookbook
$ 35.99
$ 18.00
Python Machine Learning - Second Edition Book Cover
Python Machine Learning - Second Edition
$ 31.99
$ 16.00
Natural Language Processing with Python Cookbook Book Cover
Natural Language Processing with Python Cookbook
$ 31.99
$ 16.00
Modern Python Cookbook Book Cover
Modern Python Cookbook
$ 39.99
$ 20.00
Python: Advanced Predictive Analytics Book Cover
Python: Advanced Predictive Analytics
$ 79.99
$ 16.00