当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


Python Numpy np.chebadd()用法及代码示例

借助np.chebadd()方法,我们可以通过使用获得两个切比雪夫系列的加法np.chebadd()方法。

用法: np.chebadd(s1, s2)
返回:Return an array after addition.

范例1:
在这个例子中,我们可以通过使用np.chebadd()方法,我们可以使用此方法获得两个chebyshev系列的加法。


# import numpy 
import numpy as np 
from numpy.polynomial import chebyshev as C 
  
s1 = (4, 6, 8) 
s2 = (3, 5, 7) 
# using np.chebadd() method 
gfg = C.chebadd(s1, s2) 
  
print(gfg)

输出:

[ 7. 11. 15.]

范例2:

# import numpy 
import numpy as np 
from numpy.polynomial import chebyshev as C 
  
s1 = (4, 6, 8, 1, 3, 5) 
s2 = (3, 5, 7, 2, 4, 6) 
# using np.chebadd() method 
gfg = C.chebadd(s1, s2) 
  
print(gfg)

输出:

[ 7. 11. 15. 3. 7. 11.]



相关用法


注:本文由纯净天空筛选整理自Jitender_1998大神的英文原创作品 Python | Numpy np.chebadd() method。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。