Python | Numpy np.hermgauss()方法

哎哎哎:# t0]https://www . geeksforgeeks . org/python-num py-NP-hermgauss 方法/

借助**np.hermgauss()**方法,利用np.hermgauss()方法可以得到高斯埃尔米特的求积值。

语法: np.hermgauss(degree) 返回:返回高斯埃尔米特的求积。

例#1 : 在这个例子中我们可以看到,通过使用np.hermgauss()方法,我们能够利用这个方法得到高斯埃尔米特的求积。

# import numpy and hermgauss
import numpy as np

# using np.hermgauss() method
gfg = hermgauss(3)

print(gfg)

输出:

(数组([-1.22474487,0。,1.22474487]),数组([0.29540898,1.1816359,0.29540898])

例 2 :

# import numpy and hermgauss
import numpy as np

# using np.hermgauss() method
gfg = hermgauss(5)

print(gfg)

输出:

(数组([-2.02018287,-0.95857246,0。,0.95857246,2.02018287]),数组([0.01995324,0.39361932,0.94530872,0.39361932,0.01995324])