728x90
난수의 발생
  • 이전 배열을 생성하는 함수 중 random.rand()/random.randint() 함수가 바로 난수를 생성하는 함수이다.

2020/06/10 - [파이썬\python/numpy] - 1. 기초 / 특징 /배열 생성 /전치 연산

 

1. 기초 / 특징 /배열생성 /전치연산

http://www.numpy.org NumPy Powerful N-dimensional arrays Fast and versatile, the NumPy vectorization, indexing, and broadcasting concepts are the de-facto standards of array computing today. Numeric..

chuyinchule.tistory.com


시드 설정하기 
  • 난수를 발생시킨 후 발생시킨 난수를 고정시켜주는 것을 시드(seed)라고 한다.

 np.random.seed(0)을 random.seed(0) 사용하여 난수를 고정시켜준다.


데이터 순서 교환 shuffle()
  • shuffle() : 데이터를 무작위로 섞어주는 함수 

 


데이터 샘플링 choice()
  • numpy.random.choice(a, size=None, replace=True, p=None)


데이터 카운팅 unique(), bincount()
  • unique() : 중복된 값을 제거하고 보여준다.
  • bincount() : 발생하지 않은 사건에 대해서도 카운트를 해준다.

 

 

 

728x90

+ Recent posts