Computer >> 컴퓨터 >  >> 프로그램 작성 >> Python

Python에서 Hermite_e 시리즈를 강력하게 키우기

<시간/>

Hermite_e 시리즈를 거듭제곱하려면 PythonNumpy에서 polynomial.hermite.hermepow() 메서드를 사용하십시오. 이 메서드는 Hermite_시리즈의 힘을 반환합니다. 파워 파워로 상승한 Hermite_e 시리즈 c를 반환합니다. 인수 c는 낮은 것에서 높은 것으로 정렬된 계수의 시퀀스입니다. 즉, [1,2,3]은 시리즈 P_0 + 2*P_1 + 3*P_2입니다. 매개변수 c는 낮은 값에서 높은 값으로 정렬된 Hermite_e 계열 계수의 1차원 배열입니다.

매개변수 pow는 시리즈가 상승할 거듭제곱입니다. 매개변수 maxpower는 허용되는 최대 전력입니다. 이것은 주로 시리즈의 성장을 관리할 수 없는 크기로 제한하기 위한 것입니다. 기본값은 16입니다.

단계

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

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

Hermite_e 시리즈 계수의 1차원 배열 생성 -

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

계수 배열 표시 -

print("Our coefficient 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_e 시리즈를 거듭제곱하려면 PythonNumpy에서 polynomial.hermite.hermepow() 메서드를 사용하십시오 -

print("\nResult....\n",H.hermepow(c, 3))

예시

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

# Create 1-D arrays of Hermite_e series coefficients
c = np.array([1,2,3])

# Display the coefficient array
print("Our coefficient 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 raise a Hermite_e series to a power, use the polynomial.hermite.hermepow() method in Python Numpy
# The method returns Hermite_e series of power.
print("\nResult....\n",H.hermepow(c, 3))
의 Hermite_e 시리즈를 반환합니다.

출력

Our coefficient Array...
   [1 2 3]

Dimensions of our Array...
1

Datatype of our Array object...
int64

Shape of our Array object...
(3,)

Result....
   [ 355. 642. 1119. 476. 387. 54. 27.]