<> ''from https://wikidocs.net/22849'' { np.array {{{ a = [1,2,3,4,5] # list a를 만들어서 b = np.array(a) # array 자료형으로 바꾸자 # 여기서 type(b) 하면 numpy.ndarray 라고 나온다. nd는 다차원(n-dimensional)을 뜻함. }}} np.sqrt, multiply(내적), max, min, argmax, argmin(최대값 최소값의 index) np.random.randint(9)는 0부터 9까지 숫자중 아무 숫자나 하나 생성 np.random.randint(숫자1, 숫자2, size = 난수갯수) } [[맷플럿립,Matplotlib]] tmp { numpy의 histogram 으로 도수분포도 그리기 (+matplotlib사용) https://wikidocs.net/23258 } = NumPy Types? = == ndarray == a가 있을 때 a.shape : 크기 (x, y)를 돌려줌. a.reshape(x, y) : 크기 x, y로 바꿈. np.zeros(n) : 0.으로만 이뤄진 배열을 만듦 np.ones(n) : 1.로만 다차원 배열일때는 np.zeros((행 갯수, 열 갯수)) 처럼 괄호를 두번 써야 함 원소의 index를 찾으려면 (list처럼 .index()가 아님) np.where('찾으려는 원소' == array이름) np.sum(a) : 합 np.arange(n) : 수열을 만듦. array형으로. = NumPy의 간단한 통계 기능들 = from https://wikidocs.net/23279 { ||[[평균,mean,average]] ||np.average(x) || ||[[중앙값,median]] - curr see [[대표값,평균값,중앙값,최빈값]] ||np.median(x) || ||최빈값 ||np.bincount(x).argmax() || ||[[분산,variance]] ||np.var(x) || ||[[표준편차,standard_deviation]] ||np.std(x) || } 본격적인 통계 기능은 보통 [[팬더스,Pandas]]를 사용. = 기타 = MathInspector https://mathinspector.com/ A Visual Programming Environment for Scientific Computing Free open source software designed for students, content creators, and professional mathematicians ---- Up: [[파이썬,Python]]