내가 보려고 만드는/파이썬

[파이썬] numpy의 random 모듈

gaga_ 2021. 7. 17. 00:19
  • np.random.seed(): 난수 생성에 필요한 seed를 설정
  • np.random.randint(min, max): 균일 분포의 정수 난수 1개 생성
  • np.random.rand(m, n): 0부터 1 사이의 균일 분포에서 난수 matrix array 생성
  • np.random.randn(m, n): 가우시안 표준 정규 분포에서 난수 matrix array 생성
  • np.random.normal(): 정규분포로부터 sampling된 난수를 반환
  • np.random.shuffle: 기존 데이터의 순서 바꾸기
  • np.random.choice: 주어진 1차원 array로부터 임의의 sample을 생성 
  • np.unique: 데이터에서 중복된 값을 제거하고 중복되지 않는 값의 리스트를 출력
  • np.bincount: 발생하지 않은 사건에 대해서도 카운트

 

https://numpy.org/doc/stable/reference/random/index.html?highlight=random#module-numpy.random 

 

Random sampling (numpy.random) — NumPy v1.21 Manual

Numpy’s random number routines produce pseudo random numbers using combinations of a BitGenerator to create sequences and a Generator to use those sequences to sample from different statistical distributions: Since Numpy version 1.17.0 the Generator can

numpy.org