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 plt
import sympy
import numpy as np
#
def plot_one_digit_freqs(f1):
"""
Plot one digit frequency counts using matplotlib.
"""
ax = plt.plot(f1,'bo-')
plt.title('Single digit counts in pi')
plt.xlabel('Digit')
plt.ylabel...