Python Numpy np.poly2herm()方法

Python Numpy np.poly2herm()方法

在np.poly2herm()方法的帮助下,我们可以通过使用np.poly2herm()方法从多项式中得到hermite系列的系数。

语法: np.poly2herm(polynomial)
返回:返回赫米特级数的系数。

例子#1 :
在这个例子中,我们可以看到,通过使用np.poly2herm()方法,我们能够用这个方法从多项式中得到Hermite系列的系数。

# import numpy and poly2herm
import numpy as np
from numpy.polynomial.hermite import poly2herm
  
x = np.array([0.1, 0.2, 0.3, 0.4, 0.5])
# using np.poly2herm() method
gfg = poly2herm(x)
  
print(gfg)

输出 :

[0.625 0.4 0.45 0.05 0.03125]

例子#2 :

# import numpy and poly2herm
import numpy as np
from numpy.polynomial.hermite import poly2herm
  
x = np.array([-0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5])
# using np.poly2herm() method
gfg = poly2herm(x)
  
print(gfg)

输出 :

[1.61968750e+01 1.27750000e+01 4.09828125e+01 8.50625000e+00
1.33296875e+01 1.24687500e+00 1.29765625e+00 5.78125000e-02
4.51171875e-02 7.81250000e-04 4.88281250e-04]

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程

Numpy 多项式