Để nhân chuỗi Hermite_e với x, trong đó x là biến độc lập, hãy sử dụng phương thức thepolynomial.hermite.hermemulx () trong Python Numpy. Phương thức trả về một mảng đại diện cho kết quả của phép nhân. Tham số, c là mảng 1-D gồm các hệ số chuỗi Hermite_e được sắp xếp từ thấp đến cao.
Các bước
Đầu tiên, hãy nhập thư viện được yêu cầu -
import numpy as np from numpy.polynomial import hermite_e as H
Tạo một mảng -
c = np.array([1, 2, 3])
Hiển thị mảng -
print("Our Array...\n",c) Kiểm tra các thứ nguyên -
print("\nDimensions of our Array...\n",c.ndim) Lấy Datatype -
print("\nDatatype of our Array object...\n",c.dtype) Lấy hình dạng -
print("\nShape of our Array object...\n",c.shape) Để nhân chuỗi Hermite_e với x, trong đó x là biến độc lập, hãy sử dụng phương thức thepolynomial.hermite.hermemulx () -
print("\nResult....\n",H.hermemulx(c)) Ví dụ
import numpy as np
from numpy.polynomial import hermite_e as H
# Create an array
c = np.array([1, 2, 3])
# 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 multiply the Hermite_e series by x, where x is the independent variable, use the polynomial.hermite.hermemulx() method in Python Numpy
print("\nResult....\n",H.hermemulx(c)) Đầu ra
Our Array... [1 2 3] Dimensions of our Array... 1 Datatype of our Array object... int64 Shape of our Array object... (3,) Result.... [2. 7. 2. 3.]