Python library for working with simple equations

geremy condra debatem1 at gmail.com
Thu Feb 18 10:30:29 EST 2010


On Thu, Feb 18, 2010 at 4:09 AM, lallous <lallous at lgwm.org> wrote:
> Hello
>
> Is there is any Python library that allow such things:
>
> Given a string expression as: x + 5 + x * (y + 2), any library that
> can develop the equation for example.
> Or if we say factor with "x" then it renders the expression with x *
> ( rest of expression ).
> There could be a functionality where when x,y are given then the
> expression can be evaluated.
> If there are two expressions, they can be added and the symbols
> preserved.
>
> Does such a thing exist?
>
> Thanks,
> Elias
> --
> http://mail.python.org/mailman/listinfo/python-list
>

>From sage:

>>> x = var('x')
>>> g = x**2 + x
>>> g(x=5)
30
>>> g.factor
... (x + 1)*x

Geremy Condra



More information about the Python-list mailing list