借助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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
