用 Python 将 Hermit 级数提升到某个幂次
要在 Python 中将 Hermit 级数提升到某个幂次,请使用 polynomial.hermite.hermpow() 方法。该方法返回幂次 Hermite 级数。返回到 pow 次幂的 Hermite 级数 c。参数 c 是从低到高顺序排列的一组系数。也就是说,[1,2,3] 是级数 P_0 + 2*P_1 + 3*P_2。
参数 c 是从低到高顺序排列的 Hermite 级数系数的一维数组。参数 pow 是该级数将被提升到的幂次。参数 maxpower 是允许的最大幂次。这主要用于将级数增长限制为可控的大小。默认值为 16。
步骤
首先,导入所需的库 −
import numpy as np from numpy.polynomial import hermite as H
创建 Hermite 级数系数的一维数组 −
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)要在 Python 中将 Hermite 级数提升到某个幂次,请使用 polynomial.hermite.hermpow() 方法 −
print("\nResult....\n",H.hermpow(c, 3))示例
import numpy as np
from numpy.polynomial import hermite as H
# Create 1-D arrays of Hermite 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 series to a power, use the polynomial.hermite.hermpow() method in Python Numpy
# The method returns Hermite series of power.
print("\nResult....\n",H.hermpow(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.... [2257. 2358. 3837. 908. 711. 54. 27.]
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP