다항식을 Hermite 시리즈로 변환하려면 Python Numpy에서 hermite.poly2herm() 메서드를 사용합니다. 가장 낮은 차수에서 가장 높은 차수로 정렬된 다항식의 계수를 나타내는 배열을 최저에서 최고 학위. 이 메서드는 등가의 Hermite 계열의 계수를 포함하는 1차원 배열을 반환합니다. 매개변수 pol은 다항식 계수를 포함하는 1차원 배열입니다.
단계
먼저 필요한 라이브러리를 가져옵니다 -
import numpy as np from numpy.polynomial import hermite as H
numpy.array() 메서드를 사용하여 배열 생성 -
c = np.array([1, 2, 3, 4, 5])
배열 표시 -
print("Our Array...\n",c) 치수 확인 -
print("\nDimensions of our Array...\n",c.ndim)
데이터 유형 가져오기 -
print("\nDatatype of our Array object...\n",c.dtype) 모양 가져오기 -
print("\nShape of our Array object...\n",c.shape)
다항식을 Hermite 시리즈로 변환하려면 Python Numpy에서 hermite.poly2herm() 메서드를 사용하십시오 -
print("\nResult (polynomial to hermite)...\n",H.poly2herm(c)) 예시
import numpy as np
from numpy.polynomial import hermite as H
# Create an array using the numpy.array() method
c = np.array([1, 2, 3, 4, 5])
# Display the array
print("Our Array...\n",c)
# Check the Dimensions
print("\nDimensions of our Array...\n",c.ndim)
# Get the Datatype
print("\nDatatype of our Array object...\n",c.dtype)
# Get the Shape
print("\nShape of our Array object...\n",c.shape)
# To convert a polynomial to a Hermite series, use the hermite.poly2herm() method in Python Numpy
print("\nResult (polynomial to hermite)...\n",H.poly2herm(c)) 출력
Our Array... [1 2 3 4 5] Dimensions of our Array... 1 Datatype of our Array object... int64 Shape of our Array object... (5,) Result (polynomial to hermite)... [6.25 4. 4.5 0.5 0.3125]