The concurrent.futures
module is a Python module with which we can execute callables asynchronously. If you are familiar with Java and go through the module, you will notice some similarities with the equivalent Java API, such as class names and architecture. According to the Python documentation, this is not a coincidence.
A task in this context is an autonomous unit of work. For instance, printing a document can be considered a task, but usually we consider much smaller tasks, such as adding two numbers.
The imports are as follows:
import dautil as dl import ch12util from functools import partial import matplotlib.pyplot as plt import numpy as np from scipy.stats import skew import concurrent.futures from IPython.display import HTML STATS = []
Define the following function to resample:
def resample(arr): sample = ch12util.bootstrap(arr) STATS.append((sample.mean(), sample.std(), skew(sample)))
Define the following...