You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[13.1. Simulating a discrete-time Markov chain](chapter13_stochastic/01_markov.md)
148
-
*[13.2. Simulating a Poisson process](chapter13_stochastic/02_poisson.md)
148
+
*[13.2. Simulating a Poisson process](chapter13_stochastic/02_poisson.md) *
149
149
*[13.3. Simulating a Brownian motion](chapter13_stochastic/03_brownian.md)
150
150
*[13.4. Simulating a stochastic differential equation](chapter13_stochastic/04_sde.md)
151
151
152
152
153
153
### [Chapter 14 : Graphs, Geometry, and Geographic Information Systems](chapter14_graphgeo)
154
154
155
-
*[14.1. Manipulating and visualizing graphs with NetworkX](chapter14_graphgeo/01_networkx.md)
155
+
*[14.1. Manipulating and visualizing graphs with NetworkX](chapter14_graphgeo/01_networkx.md) *
156
156
*[14.2. Drawing flight routes with NetworkX](chapter14_graphgeo/02_airports.md)
157
157
*[14.3. Resolving dependencies in a directed acyclic graph with a topological sort](chapter14_graphgeo/03_dag.md)
158
158
*[14.4. Computing connected components in an image](chapter14_graphgeo/04_connected.md)
@@ -170,11 +170,13 @@ This repository contains the sources of the book (in Markdown, [CC-BY-NC-ND lice
170
170
*[15.5. A bit of number theory with SymPy](chapter15_symbolic/05_number_theory.md)
171
171
*[15.6. Finding a Boolean propositional formula from a truth table](chapter15_symbolic/06_logic.md)
172
172
*[15.7. Analyzing a nonlinear differential system — Lotka-Volterra (predator-prey) equations](chapter15_symbolic/07_lotka.md)
173
-
*[15.8. Getting started with Sage](chapter15_symbolic/08_sage.md)
173
+
*[15.8. Getting started with Sage](chapter15_symbolic/08_sage.md) *
174
174
175
175
176
176
<!-- END_TOC -->
177
177
178
+
Recipes marked with an asterisk * are only available in the [book](https://packtpub.com/big-data-and-business-intelligence/ipython-interactive-computing-and-visualization-cookbook-second-e).
Copy file name to clipboardExpand all lines: chapter02_best_practices/09_debugging.md
+6
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@
7
7
8
8
# 2.9. Debugging code with IPython
9
9
10
+
[The recipe is available in the book, to be purchased on Packt.](https://www.packtpub.com/big-data-and-business-intelligence/ipython-interactive-computing-and-visualization-cookbook-second-e)
11
+
12
+
<!-- REMOVE AS PER PACKT AGREEMENT
13
+
10
14
Debugging is an integral part of software development and interactive computing. A widespread debugging technique consists of placing `print()` functions in various places in the code. Who hasn't done this? It is probably the simplest solution, but it is certainly not the most efficient (it is the poor man's debugger).
11
15
12
16
IPython is perfectly adapted for debugging, and the integrated debugger is quite easy to use (actually, IPython merely offers a nice interface to the native Python debugger **pdb**). In particular, tab completion works in the IPython debugger. This recipe describes how to debug code with IPython.
@@ -73,3 +77,5 @@ embed()
73
77
When your Python program reaches this code, it will pause and launch an interactive IPython terminal at this specific point. You will then be able to inspect all local variables, run any code you want, and possibly debug your code before resuming normal execution.
74
78
75
79
Most Python IDEs offer graphical debugging features (see the *Efficient interactive computing workflows with IPython* recipe). A GUI can sometimes be more convenient than a command-line debugger. A list of Python debuggers is available at https://wiki.python.org/moin/PythonDebuggingTools.
*[2.8. Writing unit tests with py.test](08_test.md)
13
-
*[2.9. Debugging code with IPython](09_debugging.md)
13
+
*[2.9. Debugging code with IPython](09_debugging.md) *
14
14
15
15
This is a special chapter about good practices in interactive computing. It describes how to work efficiently and properly with the tools this book is about. We will introduce common tools such as the Unix shell, the latest features of Python 3, and git, before tackling reproducible computing experiments (notably with the Jupyter Notebook).
Copy file name to clipboardExpand all lines: chapter03_notebook/05_custom_notebook.md
+6
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@
7
7
8
8
# 3.5. Configuring the Jupyter Notebook
9
9
10
+
[The recipe is available in the book, to be purchased on Packt.](https://www.packtpub.com/big-data-and-business-intelligence/ipython-interactive-computing-and-visualization-cookbook-second-e)
11
+
12
+
<!-- REMOVE AS PER PACKT AGREEMENT
13
+
10
14
Many aspects of the Jupyter Notebook can be configured. We covered the configuration of the IPython kernel in Chapter 1, recipe *Mastering IPython's configuration system*. In this recipe, we show how to configure the Jupyter application and the Jupyter Notebook frontend.
11
15
12
16
## How to do it...
@@ -198,3 +202,5 @@ Here are a few references:
198
202
# See also
199
203
200
204
* Chapter 1, Mastering IPython's configuration system
Copy file name to clipboardExpand all lines: chapter03_notebook/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ In this chapter, we will cover the following topics:
6
6
*[3.2. Converting a Jupyter notebook to other formats with nbconvert](02_nbformat.md)
7
7
*[3.3. Mastering widgets in the Jupyter Notebook](03_widgets.md)
8
8
*[3.4. Creating custom Jupyter Notebook widgets in Python, HTML, and JavaScript](04_custom_widgets.md)
9
-
*[3.5. Configuring the Jupyter Notebook](05_custom_notebook.md)
9
+
*[3.5. Configuring the Jupyter Notebook](05_custom_notebook.md) *
10
10
*[3.6. Introducing JupyterLab](06_jupyterlab.md)
11
11
12
12
In this chapter, we will see several advanced features and usage examples of the Jupyter Notebook. As we have only seen basic features in the previous chapters, we will dive deeper into the architecture of the Notebook here.
Copy file name to clipboardExpand all lines: chapter04_optimization/01_timeit.md
+6
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@
7
7
8
8
# 4.1. Evaluating the time taken by a command in IPython
9
9
10
+
[The recipe is available in the book, to be purchased on Packt.](https://www.packtpub.com/big-data-and-business-intelligence/ipython-interactive-computing-and-visualization-cookbook-second-e)
11
+
12
+
<!-- REMOVE AS PER PACKT AGREEMENT
13
+
10
14
The `%timeit` magic and the `%%timeit` cell magic (that applies to an entire code cell) allow us to quickly evaluate the time taken by one or several Python statements. The next recipes in this chapter will show methods for more extensive profiling.
11
15
12
16
## How to do it...
@@ -74,3 +78,5 @@ If you are not in an IPython interactive session or in a Jupyter Notebook, you c
74
78
75
79
* Profiling your code easily with cProfile and IPython
76
80
* Profiling your code line-by-line with line_profiler
Copy file name to clipboardExpand all lines: chapter04_optimization/09_hdf5_array.md
+6
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@
7
7
8
8
# 4.9. Manipulating large arrays with HDF5
9
9
10
+
[The recipe is available in the book, to be purchased on Packt.](https://www.packtpub.com/big-data-and-business-intelligence/ipython-interactive-computing-and-visualization-cookbook-second-e)
11
+
12
+
<!-- REMOVE AS PER PACKT AGREEMENT
13
+
10
14
NumPy arrays can be persistently saved on disk using built-in functions in NumPy such as `np.savetxt()`, `np.save()`, or `np.savez()`, and loaded in memory using analogous functions. Common file formats for data arrays include raw binary files as in the previous recipe, the NPY file format implemented by NumPy (which are raw binary files with a header containing the metadata), and **Hierarchical Data Format**, or **HDF5**.
11
15
12
16
An HDF5 file contains one or several datasets (arrays or heterogeneous tables) organized into a POSIX-like hierarchy. Datasets may be accessed lazily with memory mapping. In this recipe, we will use **h5py**, a Python package designed to deal with HDF5 files with a NumPy-like programming interface.
@@ -142,3 +146,5 @@ Here are a few references:
142
146
* Processing huge NumPy arrays with memory mapping
143
147
* Manipulating large heterogeneous tables with HDF5
144
148
* Ten tips for conducting reproducible interavctinve computing experiments
Copy file name to clipboardExpand all lines: chapter04_optimization/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,15 @@
2
2
3
3
In this chapter, we will cover the following topics:
4
4
5
-
*[4.1. Evaluating the time taken by a command in IPython](01_timeit.md)
5
+
*[4.1. Evaluating the time taken by a command in IPython](01_timeit.md) *
6
6
*[4.2. Profiling your code easily with cProfile and IPython](02_profile.md)
7
7
*[4.3. Profiling your code line-by-line with line_profiler](03_linebyline.md)
8
8
*[4.4. Profiling the memory usage of your code with memory_profiler](04_memprof.md)
9
9
*[4.5. Understanding the internals of NumPy to avoid unnecessary array copying](05_array_copies.md)
10
10
*[4.6. Using stride tricks with NumPy](06_stride_tricks.md)
11
11
*[4.7. Implementing an efficient rolling average algorithm with stride tricks](07_rolling_average.md)
12
12
*[4.8. Processing large NumPy arrays with memory mapping](08_memmap.md)
13
-
*[4.9. Manipulating large arrays with HDF5](09_hdf5_array.md)
13
+
*[4.9. Manipulating large arrays with HDF5](09_hdf5_array.md) *
14
14
15
15
Although Python is not generally considered as one of the fastest language (which is somehwat unfair), it is possible to achieve excelent performance with the appropriate methods. This is the objective of this chapter and the next. This chapter describes how to evaluate (**profile**) what makes a program slow, and how this information can be used to **optimize** the code and make it more efficient. The next chapter will deal with more advanced high-performance computing methods that should only be tackled when the methods described here are not sufficient.
Copy file name to clipboardExpand all lines: chapter05_hpc/12_julia.md
+6
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@
7
7
8
8
# 5.12. Trying the Julia programming language in the Jupyter Notebook
9
9
10
+
[The recipe is available in the book, to be purchased on Packt.](https://www.packtpub.com/big-data-and-business-intelligence/ipython-interactive-computing-and-visualization-cookbook-second-e)
11
+
12
+
<!-- REMOVE AS PER PACKT AGREEMENT
13
+
10
14
**Julia** (http://julialang.org) is a high-level, dynamic language for high-performance numerical computing. The first version was released in 2012 after three years of development at MIT. Julia borrows ideas from Python, R, MATLAB, Ruby, Lisp, C, and other languages. Its major strength is to combine the expressivity and ease of use of high-level, dynamic languages with the speed of C (almost). This is achieved via an LLVM-based Just-In- Time (JIT) compiler that targets machine code for x86-64 architectures.
11
15
12
16
In this recipe, we will try Julia in the Jupyter Notebook using the **IJulia** package available at https://github.com/JuliaLang/IJulia.jl. We will also show how to use Python packages (such as NumPy and matplotlib) from Julia. Specifically, we will compute and display a Julia set.
@@ -225,3 +229,5 @@ Here are some references:
225
229
* Gadfly.jl, a Julia plotting library, available at http://gadflyjl.org/stable/
226
230
* DataFrames.jl, an equivalent of pandas for Julia, available at https://github.com/JuliaStats/DataFrames.jl
227
231
* Juno, an IDE for Julia, available at http://junolab.org/
Copy file name to clipboardExpand all lines: chapter05_hpc/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ In this chapter, we will cover the following topics:
13
13
*[5.9. Distributing Python code across multiple cores with IPython](09_ipyparallel.md)
14
14
*[5.10. Interacting with asynchronous parallel tasks in IPython](10_async.md)
15
15
*[5.11. Performing out-of-core computations on large arrays with Dask](11_dask.md)
16
-
*[5.12. Trying the Julia programming language in the Jupyter Notebook](12_julia.md)
16
+
*[5.12. Trying the Julia programming language in the Jupyter Notebook](12_julia.md) *
17
17
18
18
The previous chapter presented techniques for code optimization. Sometimes, these methods are not sufficient, and we need to resort to advanced high-performance computing techniques.
Copy file name to clipboardExpand all lines: chapter06_viz/05_widgets.md
+6
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@
7
7
8
8
# 6.5. Discovering interactive visualization libraries in the Notebook
9
9
10
+
[The recipe is available in the book, to be purchased on Packt.](https://www.packtpub.com/big-data-and-business-intelligence/ipython-interactive-computing-and-visualization-cookbook-second-e)
11
+
12
+
<!-- REMOVE AS PER PACKT AGREEMENT
13
+
10
14
Several libraries provide interactive visualization of 2D or 3D data in the Notebook, using the capabilities of the Jupyter widgets. We give basic examples using four of these libraries: **ipyleaflet**, **bqplot**, **pythreejs**, and **ipyvolume**.
11
15
12
16
## Getting started
@@ -158,3 +162,5 @@ Here are several references:
158
162
* ipyvolume at https://github.com/maartenbreddels/ipyvolume
159
163
* Jupyter Google Maps at http://jupyter-gmaps.readthedocs.io/en/latest/
160
164
* An interactive 3D molecular viewer for Jupyter, based on NGL, at http://nglviewer.org/nglview/latest/
Copy file name to clipboardExpand all lines: chapter06_viz/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ In this chapter, we will cover the following topics:
6
6
*[6.2. Creating statistical plots easily with seaborn](02_seaborn.md)
7
7
*[6.3. Creating interactive Web visualizations with Bokeh and HoloViews](03_bokeh.md)
8
8
*[6.4. Visualizing a NetworkX graph in the Notebook with D3.js](04_d3.md)
9
-
*[6.5. Discovering interactive visualization libraries in the Notebook](05_widgets.md)
9
+
*[6.5. Discovering interactive visualization libraries in the Notebook](05_widgets.md) *
10
10
*[6.6. Creating plots with Altair and the Vega-Lite specification](06_altair.md)
11
11
12
12
While matplotlib is the main visualization library in Python, it is not the only one. In this chapter, we will introduce some of the many other visualization libraries that cover more domain-specific use-cases, or that offer specific interactivity features in the Jupyter Notebook.
0 commit comments