python/numpy

numpy에서 자주 사용되는 함수

jwjwvison 2021. 3. 28. 23:43
import numpy as np
  • numpy documentation
    • numpy 공식 문서 링크 
    • numpy 에서 제공되는 함수등에 대한 문서

numpy.org/devdocs/reference/

 

NumPy Reference — NumPy v1.21.dev0 Manual

This reference manual details functions, modules, and objects included in NumPy, describing what they are and what they do. For learning how to use NumPy, see the complete documentation. Acknowledgements Large parts of this manual originate from Travis E.

numpy.org

 

  • 연산 함수
    • add, substract, multiply, divide

 

  • 통계 함수
    • 평균, 분산, 중앙, 최대, 최소값 등등 통계 관련된 함수가 내장

 

  • 집계함수
    • 합계(sum), 누적합계(cumsum) 등등 계산 가능

 

  • any,all 함수
    • any: 특정 조건을 만족하는 것이 하나라도 있으면 True, 아니면 False
    • all: 모든 원소가 특정 조건을 만족한다면 True, 아니면 False

 

  • where 함수
    • 조건에 따라 선별적으로 값을 선택 가능
    • 사용 예) 음수인경우는 0, 나머지는 그대로 값을 쓰는 경우