Applying doit on all unevaluated objects

17 views
Skip to first unread message

Kasper Peeters

unread,
Oct 19, 2015, 7:36:41 AM10/19/15
to sympy
If I have an expression with a bunch of unevaluated 'Integral', 'Sum' and so on, what is the recommended way to apply 'doit()' on all of these in one shot?

Cheers,
Kasper

Francesco Bonazzi

unread,
Oct 19, 2015, 8:14:56 AM10/19/15
to sympy
Could you paste your expression or an example of it?

Francesco Bonazzi

unread,
Oct 19, 2015, 8:28:17 AM10/19/15
to sympy
From the documentation of .doit():

Evaluate objects that are not evaluated by default like limits,
integrals, sums and products. All objects of this kind will be
evaluated recursively, unless some species were excluded via 'hints'
or unless the 'deep' hint was set to 'False'.

So I suppose you can simply call .doit() on the root expression, or .doit(deep=False) if you don't want it to recursively apply to subexpressions.
Reply all
Reply to author
Forward
0 new messages