Universal functions

2022. 2. 25. 10:54·[Library] - Numpy/Quick Start

이번 포스트에서는 universal function에 대해 알아볼 것이다.

 

넘파이에서는 np.sin, np.cos, np.exp와 같은 친숙한 수학적 함수들을 제공한다. 넘파이에서는 이러한 함수들을 universal function(범용 함수)이라고 부른다. 이러한 함수들은 피연산자 배열의 원소 단위로 연산이 수행되며, 결과를 새로운 행렬로 반환한다.

 

B = np.arange(3)
B
>>>
array([0, 1, 2])

np.exp(B)
>>>
array([1.        , 2.71828183, 7.3890561 ])

np.sqrt(B)
>>>
array([0.        , 1.        , 1.41421356])

C = np.array([2., -1., 4.])
np.add(B, C)
>>>
array([2., 0., 6.])

 

universal function은 너무 많기 때문에 필요한 포스트에서 전부 다루기는 어렵다. 고로, 아래의 링크들을 참고하여 필요한 함수를 찾는것이 좋다.

 

참고

https://numpy.org/devdocs/user/quickstart.html

 

NumPy quickstart — NumPy v1.23.dev0 Manual

NumPy provides familiar mathematical functions such as sin, cos, and exp. In NumPy, these are called “universal functions” (ufunc). Within NumPy, these functions operate elementwise on an array, producing an array as output. See also all, any, apply_al

numpy.org

https://numpy.org/doc/stable/reference/ufuncs.html

 

Universal functions (ufunc) — NumPy v1.22 Manual

Tip The Python function max() will find the maximum over a one-dimensional array, but it will do so using a slower sequence interface. The reduce method of the maximum ufunc is much faster. Also, the max() method will not give answers you might expect for

numpy.org

https://rfriend.tistory.com/293

 

[Python NumPy] 범용 함수 (universal functions) : (1-1) 단일 배열 unary ufuncs : 올림 혹은 내림 (rounding)

이번 포스팅부터는 몇 번에 나누어서 로그함수, 삼각함수, 사칙연산 함수 등과 같이 일반적으로 많이 사용되는 범용 함수 (universal functions)들에 대해서 소개하겠습니다. Python에서 범용 함수를

rfriend.tistory.com

 

'[Library] - Numpy > Quick Start' 카테고리의 다른 글

Basic Operations  (0) 2022.02.19
Printing Arrays  (0) 2022.02.19
Numpy Array Creation  (0) 2022.01.09
Numpy 기초  (0) 2022.01.07
'[Library] - Numpy/Quick Start' 카테고리의 다른 글
  • Basic Operations
  • Printing Arrays
  • Numpy Array Creation
  • Numpy 기초
Bebsae
Bebsae
  • Bebsae
    뱁새zip
    Bebsae
  • 전체
    오늘
    어제
    • 분류 전체보기 (108)
      • [DevOps] - Kubernetes (5)
      • [DevOps] - AWS (1)
      • [AI] - Machine Learning (19)
      • [AI] - Neural Network (7)
      • [CS] - Network (2)
      • [CS] - Data Structure (3)
      • [CS] - Design Pattern (6)
      • [Language] - Python (15)
      • [Library] - Numpy (7)
        • Quick Start (5)
        • API (2)
      • [Framework] - Django (3)
      • [Framework] - QGIS (6)
      • [Framework] - PyQT (4)
      • [Mathematics] - Linear Alge.. (14)
      • [Mathematics] - Statistical (2)
      • [ETC] - Python (3)
      • [ETC] - C++ (1)
      • [ETC] - Linux (1)
      • 논문 (5)
      • 회고록 (3)
      • 생산성 (1)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • 깃허브
  • 공지사항

  • 인기 글

  • 태그

    Learning
    linearalgebra
    MachineLearning
    디자인패턴
    신경망
    DEEPLEARNING
    선형대수
    Convolution
    decomposition
    머신러닝
    파이썬
    algebra
    Machine
    Linear
    Python
    numpy
    QGIS
    교차검증
    RNN
    분해
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
Bebsae
Universal functions
상단으로

티스토리툴바