함수 | 설명 |
np.random.normal(loc=0.0, scale=1.0, size=None) | 정규분포 함수 정규 분포 확률 밀도에서 표본 추출 (정규 분포) 정규분포는 평균 0, 표준 편차 1인 데이터이다. shape를 전달하면 그 크기에 맞는 다차원 배열을 생성 loc: 정규 분포의 평균, 기본값 0 scale: 표준편차, 기본값 1 |
np.random.randn(d0,d1,...,dn) |
Shape이 (d0, d1, ..., dn) 인 배열 생성 후 난수로 초기화 난수: [0. 1)의 균등 분포(Uniform Distribution) 형상으로 균등한 비율로 표본 추출 Gaussian normal |
np.random.rand(d0,d1,...,dn) |
(d0, d1, ..., dn) shape 배열 생성 후 난수로 초기화 난수: 표준 정규 분포(standard normal distribution)에서 표본 추출 np.random.randn은 정규 분포로 표본 추출 |
np.random.randint(low, high=None, size=None, dtype='l') |
지정된 shape으로 배열을 만들고 low 부터 high 미만의 범위에서 정수 표본 추출 |
np.random.random(size=None) | 난수: (0., 1.)의 균등 분포(Uniform Distribution)에서 표본 추출 |
09. Broadcasting (0) | 2023.11.08 |
---|---|
08. Indexing / Slicing (0) | 2023.11.08 |
07. 배열의 연산-2 (0) | 2023.11.08 |
댓글 영역