在 Python 中将 Hermite_e 级数升至幂运算
要将 Hermite_e 级数升至幂运算,请在 Python Numpy 中使用 polynomial.hermite.hermepow() 方法。该方法返回幂运算的 Hermite_e 级数。返回升至 pow 功率的 Hermite_e 级数 c。参数 c 是从低到高排列的系数序列。即,[1,2,3] 是级数 P_0 + 2*P_1 + 3*P_2。参数 c 是从低到高排列的 Hermite_e 级数系数的一维数组。
参数 pow 是将级数升至的幂运算。参数 maxpower 是允许的最大幂。主要是为了限制该级数增长到无法管理的大小。默认值为 16。
步骤
首先,导入所需的库 −
import numpy as np from numpy.polynomial import hermite_e as H
创建 Hermite_e 级数系数的一维数组 −
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 级数升至幂运算,请在 Python Numpy 中使用 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))输出
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.]
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP