parse_expr for Abs(-1)

38 views
Skip to first unread message

Victor Kam

unread,
Feb 24, 2016, 11:51:46 AM2/24/16
to sympy
I have an expression, something as simple as |-1|, i.e. Abs(-1).  I don't want it to evaluate to its value, i.e. 1, for printing reasons. I tried:

parse_expr("Abs(-1)", evaluate=False)

But it gives me the evaluated expression anyway.  In fact, I can't figure out how to get the expression tree to just keep this Abs function with its argument.

So if I want it to display |-1| but not its value, how would I go about doing it?  Thanks.

Sudhanshu Mishra

unread,
Feb 24, 2016, 12:30:04 PM2/24/16
to sy...@googlegroups.com
Hi

Abs(-1, evaluate=False) will stay without evaluating itself.

Sudhanshu Mishra

--
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 sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
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/b7f0145e-3d2c-4281-b036-468f7fdeb6eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages