What is SymPy?

Make a note about SymPy

SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python.

Resources

In [5]:
from sympy import Symbol, lambdify
def Unit(x):
    if(x != 0):
        return 0
    else:
        return 1

x = Symbol('x')
x
Out[5]:
$\displaystyle x$

Maths formatted output!

In [6]:
fx = x**2 + Unit(x)
fx
Out[6]:
$\displaystyle x^{2}$
In [7]:
lam_f = lambdify(x, fx, modules=['sympy'])
lam_f
Out[7]:
<function _lambdifygenerated(x)>
In [8]:
print(lam_f(-1)) # prints 1
1