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


Python Numpy polynomial legline()用法及代碼示例


np.legline()方法用於查找圖為直線的Legendre係列。

用法: np.legline(off, scl)
參數:
off, scl :[scalar] The specified line is given by off + scl*x.

返回:[ndarray]所得行的Legendre級數係數數組。


代碼1:

# Python program explaining  
# numpy.legline() method   
      
# importing numpy as np    
# and numpy.polynomial.legendre module as geek   
import numpy as np   
import numpy.polynomial.legendre as geek  
      
# using np.legline() method   
res = geek.legline(2, 3)   
    
# Resulting legendre series  
print (res)  
輸出:
[2 3]

代碼2:

# Python program explaining  
# numpy.legline() method   
      
# importing numpy as np    
# and numpy.polynomial.legendre module as geek   
import numpy as np   
import numpy.polynomial.legendre as geek  
      
  
# using np.legline() method   
res = geek.legline(1, 4)   
    
# Resulting legendre series  
print (res)
輸出:
[1 4]



相關用法


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