Python NumPyLesson 1000Free preview
NumPy Random
This lesson is part of Python · All levels
Summary
The NumPy.random module provides a function to generate random numbers for simulation, weight initialisation, and data sharing. Rand() is available for decimal numbers 0 to 1, randint() for integers in the range, as well as choice() for selecting random elements from the set. The np.random.seed() function locks a random generator so that the same result appears in each experiment. Reproductivity like this is essential so that experiments can be repeated by others with identical results.
Key points
- It generates a random float 0 to 1.
- It produces high exclusive integers.
- Select random elements from a list or array
- It makes random results reproducible.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.