The SymPy name for exp(1) is E.

If you are using sympify() or parse_expr() you can map e to E using locals:

In [38]: sympify('log(e)', locals={'e': E})
Out[38]: 1

That's basically equivalent to running

e = E

before the given expression.

Aaron Meurer

On Wed, Nov 2, 2016 at 10:35 AM, נדב שוייגר <[email protected]> wrote:
> Hi, I'm creating a derivative tool as an exercise using SymPy.
>
> I get this following problem when using it:
> The tool is based on receiving textual user input and assuming deriving in
> respect to 'x'.
> In order to do so, i set x as a symbol and pass it as the second parameter
> to diff().
> When differentiating "e**x" I get: "e**x*log(e)". This answer, while
> correct, bothers me because I'd like SymPy to know that log(e) == 1.
>
> Any help?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/938ae0c0-eedb-4442-8e26-4b91a65a3301%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2Bhp%3DD8EqgZPMFCa26bdCWuVj5gAfVGXVmzMXBmmfmzYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to