What does the np.random.seed() function in NumPy do?
Correct answer
A. Seeds the random number generator for reproducibility
16 views
A. Seeds the random number generator for reproducibility
16 views
np.random.seed() seeds the random number generator for reproducibility. Using the same seed produces the same "random" numbers on every run, which is essential for debugging and for repeatable experiments.
Newer code often uses np.random.default_rng(seed) instead.
Keep preparing with more Data Science MCQs on MCQsExam.com.
Not sure why the answer is A? Ask here and get an explanation.