1. Học hỏi
  2. /
  3. Khoa Học
  4. /
  5. Sampling in Python

Connected

Bài tập

Understanding random seeds

While random numbers are important for many analyses, they create a problem: the results you get can vary slightly. This can cause awkward conversations with your boss when your script for calculating the sales forecast gives different answers each time.

Setting the seed for numpy's random number generator helps avoid such problems by making the random number generation reproducible.

Hướng dẫn 1/3

undefined XP
    1
    2
    3

Câu hỏi

Which statement about x and y is true?

import numpy as np
np.random.seed(123)
x = np.random.normal(size=5)
y = np.random.normal(size=5)

Các phương án trả lời