You could also use expr.as_base_exp(), which works even if expr is not a Pow.
Aaron Meurer On Mon, Apr 2, 2012 at 11:43 AM, Sai Nikhil <tsnleg...@gmail.com> wrote: > firstly one has to know under which category the function comes, in sympy > > eg. e=1/log(x)**2 the command, e.func gives sympy.core.power.Pow and so, its > the core module one has to target at. I went there and opened power.py and > searched through the class Pow, to get the attribute exp. > > therefore, the command e.exp gives me the exponent of the base i.e., ' -2 ' > here and the command e.base gives me the base i.e., 'log(x)' > > > > -thanks, > Sai Nikhil.T > > > > 1 > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sympy@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.