NumPy RandomLesson 17Free preview
Random Intro
This lesson is part of NumPy · All levels
Summary
The np.random module provides a random number generator for simulation, model weight initialisation, and data sharing. Functions generally include random, randint, and choice, with np.random.seed() so that results can be reproduced. Understanding seeding is essential for repeating experiments with the same results.
Key points
- Np.random.random(n) yields n random float numbers in the range [0, 1).
- It produces a random integer.
- It makes random results reproducible.
- Np.random.choice selects one or more random elements from the array.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.