借助sympy.as_leading_term()方法中,我們可以看到作為參數傳遞給變量的變量的數學表達式中的前導項sympy.as_leading_term()方法。
用法:sympy.as_leading_term(variable)
返回:Return a function or expression of a leading term.
範例1:
在這個例子中,我們可以通過使用sympy.as_leading_term()方法,我們可以檢查作為參數傳遞的變量的數學函數的前置項。
# import sympy 
from sympy import * 
  
x, y = symbols('x y') 
  
# Use sympy.as_leading_term(variable) method 
gfg = (x**2 + 2 * x*y + y**2).as_leading_term(y) 
    
print(gfg)輸出:
x**2
範例2:
# import sympy 
from sympy import * 
  
x, y = symbols('x y') 
  
# Use sympy.as_leading_term(variable) method 
gfg = (x * sin(x)*cos(y) + log(tan(x))).as_leading_term(y) 
    
print(gfg)輸出:
x*sin(x) + log(tan(x))
相關用法
- Python set()用法及代碼示例
 - Python os.dup()用法及代碼示例
 - Python next()用法及代碼示例
 - Python os.set_blocking()用法及代碼示例
 - Python os.get_blocking()用法及代碼示例
 - Python PIL blend()用法及代碼示例
 - Python Tensorflow sin()用法及代碼示例
 - Python PIL ImageChops.add()用法及代碼示例
 - Python PIL composite()用法及代碼示例
 - Python Tensorflow tan()用法及代碼示例
 - Python PIL copy()用法及代碼示例
 - Python os.open()用法及代碼示例
 - Python hasattr()用法及代碼示例
 - Python os.setreuid()用法及代碼示例
 
注:本文由純淨天空篩選整理自Jitender_1998大神的英文原創作品 Python | sympy.as_leading_term() method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
