Hands-on: Random numbers
In this exercise we practice creating arrays of random numbers.
Source code for this exercise is located in
Generate a one dimensional 1000 element array of uniformly distributed random
numbers using the
- Calculate the mean and standard deviation of the array using
- Choose some other random distribution and calculate its mean and standard deviation.
You can visualize the random distributions with matplotlib’s
import matplotlib.pyplot as plt plt.hist(x) plt.show()
© CC-BY-NC-SA 4.0 by CSC - IT Center for Science