Loading Python Libraries
Python is an open source programming language. There is a base Python library assumed to handle all of you basic needs. Python being open source you can add functions and additional applications. These additional functions are called libraries. You can load more libraries into a Python session to give your python more abilities. Below are instructions on how to import a Python library. If you encounter errors attempting to install and load Python libraries check out our other FAQ Create Virtual Environment
- Open Python. Start menu underneath ‘P’.
- Input following code to import library. Example below is importing ‘scipy’ library.
import scipy as sc
- Perform commands and actions with library. Submit programs.
#Example below will import and use numpy library.
#Example will create a list of random numbers and sort them.
import numpy as np
x = np.random.random(10)
Note: You must install and load Python libraries every time you open a new Python session.