要将多项式转换为hermite级数,请在python中使用hermite_e.poly2herme()方法
numpy. convert an array representing the coefficients of a polynomial ordered from lowest degree到最高点,到等效hermite级数的系数数组,从低到高排序最高次数。该方法返回一个包含等效系数的一维数组hermite系列。参数pol是一个包含多项式系数的1-d数组步骤首先,导入所需的库 −
import numpy as npfrom numpy.polynomial import 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中使用hermite_e.poly2herme()方法
numpy. convert an array representing the coefficients of a polynomial ordered from lowest degree到最高点,到等效hermite级数的系数数组,从低到高排序最高学位 −
print("\nresult (polynomial to hermite_e)...\n",h.poly2herme(c))
exampleimport numpy as npfrom numpy.polynomial import hermite_e as h# create an array using the numpy.array() methodc = np.array([1, 2, 3, 4, 5])# display the arrayprint("our array...\n",c)# check the dimensionsprint("\ndimensions of our array...\n",c.ndim)# get the datatypeprint("\ndatatype of our array object...\n",c.dtype)# get the shapeprint("\nshape of our array object...\n",c.shape)# to convert a polynomial to a hermite series, use the hermite_e.poly2herme() method in python numpyprint("\nresult (polynomial to hermite_e)...\n",h.poly2herme(c))
输出our array... [1 2 3 4 5]dimensions of our array...1datatype of our array object...int64shape of our array object...(5,)result (polynomial to hermite_e)... [19. 14. 33. 4. 5.]
以上就是将一个多项式转换为python中的hermite_e级数的详细内容。