Get startedGet started for free

Sampling with replacement

In this example, you will review the np.random.choice() function that you've already seen in the previous chapters. You are given multiple variations of np.random.choice() for sampling from arrays. Look at each variation carefully and use the console to test out the options. Select the option that could generate ['a', 'c', 'c'] as an output.

This exercise is part of the course

Statistical Simulation in Python

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise