當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


Python Numpy np.polydomain()用法及代碼示例


借助np.polydomain()方法,我們可以得到具有多項式序列值數組([-1,1])的濾波器。

用法: np.polydomain
返回:Return filter of array([-1, 1])

範例1:


# Python program explaining 
# numpy.polydomain() method  
  
# import numpy and polydomain 
import numpy as np 
from numpy.polynomial.polynomial import polydomain 
  
# using np.polydomain() method 
for i in range(5):
    ans = polydomain + [i, i + 1] 
    print(ans)

輸出:

[-1 2]
[0 3]
[1 4]
[2 5]
[3 6]

範例2:

# Python program explaining 
# numpy.polydomain() method  
  
# import numpy and polydomain 
import numpy as np 
from numpy.polynomial.polynomial import polydomain 
  
# using np.polydomain() method 
for i in range(4):
    ans = polydomain + [i-1, i + 1] 
    print(ans)

輸出:

[-2 2]
[-1 3]
[0 4]
[1 5]



相關用法


注:本文由純淨天空篩選整理自jana_sayantan大神的英文原創作品 Python | Numpy np.polydomain() method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。