Python Numpy.log()-로그

Numpy.log()
함수는 자연 로그 주어진 배열의 모든 요소.
numpy.log()
의 구문
numpy.log(arr)
매개 변수
arr |
입력 배열 |
반환
입력 배열에있는 각 요소의 자연 로그 배열을 반환합니다.
예제 코드: numpy.log()
import numpy as np
arr = [1, np.e, np.e**2, np.e**3]
print(np.log(arr))
출력:
[0. 1. 2. 3.]
예제 코드: numpy.log2()
-Numpy 로그 기준 2
numpy.log2()
는numpy.log()
와 유사하지만 기본은e
대신 2입니다.
import numpy as np
arr = [1, 2, np.e, 4]
print(np.log2(arr))
출력:
[0. 1. 1.44269504 2.]
예제 코드: numpy.log10()
-로그 기준 10
numpy.log10()
은numpy.log()
와 유사하지만 기본이e
대신 10입니다.
import numpy as np
arr = [1, np.e, 10, 100]
print(np.log10(arr))
출력:
[0. 0.43429448 1. 2.]
튜토리얼이 마음에 드시나요? DelftStack을 구독하세요 YouTube에서 저희가 더 많은 고품질 비디오 가이드를 제작할 수 있도록 지원해주세요. 구독하다
작가: Jinku Hu
Founder of DelftStack.com. Jinku has worked in the robotics and automotive industries for over 8 years. He sharpened his coding skills when he needed to do the automatic testing, data collection from remote servers and report creation from the endurance test. He is from an electrical/electronics engineering background but has expanded his interest to embedded electronics, embedded programming and front-/back-end programming.
LinkedIn Facebook