Loading...
Generate a bootstrap sample (sampling with replacement) using a given list of random indices.
Given a dataset of n items, a bootstrap sample draws n items with replacement. To make this deterministic, you are given a list of indices to draw.
Return the selected items as a list.
data = ['a', 'b', 'c', 'd'] indices = [0, 2, 2, 1]
['a', 'c', 'c', 'b']
data = ['a', 'b', 'c', 'd'] and the list of indices to draw is indices = [0, 2, 2, 1].0 corresponds to 'a', the second index 2 corresponds to 'c', the third index 2 again corresponds to 'c', and the fourth index 1 corresponds to 'b'.['a', 'c', 'c', 'b'].