Quick to use
In the Anaconda integrated Environment Spyder, you can
Preferences > IPython Console > Advanced Settings > Use symbolic Math
To activate the IPython ' s Symbolic PYthon (sympy) module
This module allows you Spyder
to Latex
render a very beautiful mathematical expression in style, and IPython
automatically imports some basic symbol objects at the terminal when it is launched.
>>> fromimport division>>> fromimport *>>> x, y, z, t = symbols(‘x y z t‘)>>> k, m, n = symbols(‘k m n‘, integer=True)>>> f, g, h = symbols(‘f g h‘, cls=Function)
Enter the following command at the terminal
>>> fromimport *>>> x = symbols(‘x‘)>>> a = Integral(cos(x)*exp(x), x)>>> Eq(a, a.doit())
The terminal displays the results as follows:
You can see the result of the output is very beautiful!
More about
SymPy Home Address: http://www.sympy.org/en/index.html
More instance codes and instructional documents can be found on the official website
It's interesting to have an online sympy Shell
Enter an expression in the intended Web page, and then get the returned results, such as entering
>>> expr = x**2 + x*y>>> srepr(expr)>>> expr = (x + y)**5>>> expand(expr)
The returned results can be seen in the SymPy Live Shell on the right, very nice!
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The Python symbol calculates the Swiss army knife--sympy