要将多项式转换为 Hermite 系列,请使用herme()Python Numpy 中的 hermite_e.poly2 方法。将表示从最低度到最高排序的多项式系数的数组转换为从最低到最高排序的等效 Hermite 级数的系数数组。该方法返回一个包含等效 Hermite 级数系数的一维数组。参数 pol 是一个包含多项式系数的一维数组
脚步
首先,导入所需的库 -
import numpy as np fromnumpy.polynomialimport hermite_e as H
使用该方法创建一个数组-numpy.array()
c = np.array([1, 2, 3, 4, 5])
显示数组 -
print("Our 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 系列,请使用herme()Python Numpy 中的 hermite_e.poly2 方法。将表示从最低度到最高排序的多项式系数的数组转换为等效 Hermite 级数的系数数组,从最低到最高排序 -
print("\nResult (polynomial to hermite_e)...\n",H.poly2herme(c))
示例
import numpy as np fromnumpy.polynomialimport hermite_e as H #使用 numpy.array() 方法创建一个数组 c = np.array([1, 2, 3, 4, 5]) #显示数组 print("Our 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 系列,请使用 Python Numpy 中的 hermite_e.poly2herme() 方法 print("\nResult (polynomial to hermite_e)...\n",H.poly2herme(c))输出结果
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.]