NumPy hermite 级数相乘:``np.hermmul()`` 用法与示例


发布日期 : 2020-01-05 21:09:47 UTC

访问量: 10 次浏览

Python Numpy np.hermmul() 方法

np.hermmul() 方法的帮助下,我们可以通过 np.hermmul() 方法得到两个赫米特(Hermite)数列的乘法。

语法:
np.hermmul(series1, series2)

返回:
返回乘法后的系列系数。

例子#1 :

在这个例子中,我们可以看到,通过使用 np.hermmul() 方法,我们能够得到两个赫米特(Hermite)级数相乘后的系数。

# import numpy and hermmul
import numpy as np
from numpy.polynomial.hermite import hermmul
  
series1 = np.array([1, 2, 3, 4, 5])
series2 = np.array([6, 7, 8, 9, 10])
  
# using np.hermmul() method
gfg = hermmul(series1, series2)
  
print(gfg)

输出:

[21154. 17903. 44860. 13458. 16278. 2154. 1706. 85. 50.]

例子#2 :

# import numpy and hermmul
import numpy as np
from numpy.polynomial.hermite import hermmul
  
series1 = np.array([1, 2, 3])
series2 = np.array([1, 2, 3])
  
# using np.hermmul() method
gfg = hermmul(series1, series2)
  
print(gfg)

输出:

[81. 52. 82. 12. 9.]