← Quiz: NumPy: all 10 questions
Quiz: NumPy · Question 10 of 10
Why create random numbers with np.random.defaultrng(42)?
Why create random numbers with np.random.default_rng(42)?
- A.Seed 42 gives more random numbers
- B.The same seed gives the same numbers every run, so experiments are reproducible
- C.It is the only way to get integers
- D.It makes the numbers normally distributed
Answer & explanation
Correct answer: The same seed gives the same numbers every run, so experiments are reproducible
default_rng is also the modern replacement for np.random.seed().
Can you get the rest right without peeking?
Take the timed Quiz: NumPy quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →