Hi not sure if I am right but there is mistake with parenthesis should be
idx = np.random.choice(range(len(probs)), p = probs)
instead of
idx = np.random.choice(range(len(probs), p = probs)) ?
Yes, you are correct.
It will be fixed in the next update of this notebook.