>  기사  >  백엔드 개발  >  Python에서 다항식을 Hermite_e 시리즈로 변환

Python에서 다항식을 Hermite_e 시리즈로 변환

WBOY
WBOY앞으로
2023-09-08 08:25:021128검색

Python에서 다항식을 Hermite_e 시리즈로 변환

다항식을 Hermite 계열로 변환하려면 Python에서 hermite_e.poly2herme() 메서드를 사용하세요

Numpy. 가장 낮은 차수부터 정렬된 다항식의 계수를 나타내는 배열을 변환합니다. 가장 높은 지점으로, 등가의 Hermite 계열의 계수 배열로, 낮은 것에서 높은 것으로 정렬됩니다. 최대 횟수입니다. 이 메소드는 등가 계수를 포함하는 1차원 배열을 반환합니다. 에르미트 시리즈. 매개변수 pol은 다항식 계수를 포함하는 1차원 배열입니다.

Steps

먼저 필요한 라이브러리를 가져옵니다. −

import numpy as np
from numpy.polynomial import hermite_e as H

numpy.array() 메서드를 사용하여 배열을 만듭니다. −

c = np.array([1, 2, 3, 4, 5])

배열을 표시합니다. −

print("Our Array...\n",c)

Check 차원 −

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에서 hermite_e.poly2herme() 메서드를 사용하세요

Numpy. 가장 낮은 차수부터 정렬된 다항식의 계수를 나타내는 배열을 변환합니다. 가장 높은 지점으로, 등가 Hermite 계열의 계수 배열로, 낮은 것에서 높은 것으로 정렬됩니다. 최고 학위 −
print("\nResult (polynomial to hermite_e)...\n",H.poly2herme(c))

Example

import numpy as np
from numpy.polynomial import hermite_e 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_e.poly2herme() method in Python Numpy
print("\nResult (polynomial to hermite_e)...\n",H.poly2herme(c))

Output

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_e)...
   [19. 14. 33. 4. 5.]

위 내용은 Python에서 다항식을 Hermite_e 시리즈로 변환의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 tutorialspoint.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제