It would be nice to use this:
https://github.com/mattpap/mathematica-parser/blob/cc38fd2aed8debfe0e4f08453d8f24b70784c494/src/main/scala/MathematicaParser.scala
Unfortunately, being written in Scala, it's really hard to include it into
Python.
Anyways, the precedence operators are very clear:
The regex parser fails to recognize in expressions such as *1/(4x-1)*, that
4x is 4 times x.
I tried to call *M(1/(4x - 1))* and I got the following transformation:
Integer (1 )/(Integer (4 )Symbol ('x' )-Integer (1 ))
Obviously, Integer(4) Symbol('x') is not valid, as an asterisk (*) is
On Thursday, November 27, 2014 2:28:11 PM UTC+1, Francesco Bonazzi wrote:
your_mathematica_expr = '((-2x+5)(4x-1)-4(-x^2+5x+1))/(4x-1)^2'
new_math_expr = re.sub(([0-9])\ *([a-zA-Z]), \\1 * \\2,
your_mathematica_expr)
M(new_math_expr)
Remember *import re* to use the *re* module.
--
Does sympy really spell simplify without the L?
On Thursday, November 27, 2014 5:29:16 AM UTC-8, Francesco Bonazzi wrote:
On Thursday, November 27, 2014 2:28:11 PM UTC+1, Francesco Bonazzi wrote:
your_mathematica_expr = '((-2x+5)(4x-1)-4(-x^2+5x+1))/(4x-1)^2'
new_math_expr =
answering my own question ... oh
it is creating a sympy object, not simplifying.
Sorry for the noise.
'RJF
On Thursday, November 27, 2014 11:46:39 AM UTC-8, Richard Fateman wrote:
Does sympy really spell simplify without the L?
--
You received this message because you are subscribed to
thanks for your kind help ! then it is surely a bug of the parser.
At 2014-11-27 21:29:16, Francesco Bonazzi franz.bona...@gmail.com wrote:
On Thursday, November 27, 2014 2:28:11 PM UTC+1, Francesco Bonazzi wrote:
your_mathematica_expr ='((-2x+5)(4x-1)-4(-x^2+5x+1))/(4x-1)^2'
I reported the bug here https://github.com/sympy/sympy/issues/8535
在 2014年11月27日星期四UTC+8下午8时42分53秒,Lee Philip写道:
test code here, error encountered there .
http://codepad.org/hZEmO4Po
what I want to do here is just convert it to a Python acceptable
expression ,is there an easy way ?
--