Python Libraries: Libraries
The following libraries will be covered:
- Sympy: a library for symbolic computation where variables are represented as symbols
- Numpy: a library for numerical computation using numbers
- Scipy: a library that has functions for solving equations numerically, will be covered as a numerical equivalent to Sympy’s solve functions
- Matplotlib: a graphing library
- Pandas: a library for building and manipulating data tables
Import Library
Libraries are collections of functions that need to be imported. To import a library do one of the following:
import <library>
- Imports the entire library. To call a function from the library, use
<library>.<function>()
- Example:
import numpy
, then call the functionnumpy.pi
- Imports the entire library. To call a function from the library, use
import <library> as <name>
- Imports the entire library as a different name. To call a function from the library, use
<name>.<function>()
- Example:
import numpy as np
, then call the functionnp.pi
- Imports the entire library as a different name. To call a function from the library, use
from <library> import <function>
- Imports only the function from the library and nothing else. To call the function, use
<function>()
- Example:
from numpy import pi
, then call the functionpi
- Imports only the function from the library and nothing else. To call the function, use