Generating random numbers
You've used .sample() to generate pseudo-random numbers from a set of values in a DataFrame. A related task is to generate random numbers that follow a statistical distribution, like the uniform distribution or the normal distribution.
Each random number generation function has distribution-specific arguments and an argument for specifying the number of random numbers to generate.
matplotlib.pyplot is loaded as plt, and numpy is loaded as np.
Deze oefening maakt deel uit van de cursus
Sampling in Python
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Generate random numbers from a Uniform(-3, 3)
uniforms = ____
# Print uniforms
print(uniforms)