Parallel processing in Python

The following example is about computing π digits and is borrowed from the website http://ipyparallel.readthedocs.io/en/latest/demos.html#parallel-examples. Since the first part needs a program called one_digit_freqs() function, we could run a Python program called pidigits.py contained at .../ipython-ipython-in-depth-4d98937\examples\Parallel Computing\pi, and this path depends on where the reader downloaded and saved his/her files.

To complete our part, we simply include it in the first part of the program, as shown here:

import matplotlib.pyplot as pltimport sympyimport numpy as np #def plot_one_digit_freqs(f1):    """    Plot one digit frequency counts using matplotlib.    """    ax = plt.plot(f1,'bo-') plt.title('Single ...

Get Hands-On Data Science with Anaconda now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.