The Python symbol calculates the Swiss army knife--sympy

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.