Member-only story
Hi everyone, welcome back. NumPy is a library for the Python programming language. NumPy is short for “Numerical Python” and is a popular library that is used in data science. NumPy is used specifically to work with arrays as it provides various functions and support. We will go over how to get started with NumPy and some of the basic array functionalities.
Installation
In order to work with NumPy, we will need to have Python and PIP installed. Python can be downloaded and installed here. PIP can be downloaded an installed here. With both Python and PIP installed, we can then install NumPy using pip through the command line. Open up a command prompt or a terminal and enter:
pip install numpy
NumPy can also be used in Python distributions such as Anaconda and Spyder.
Importing
Now we want to import NumPy into our project to use. We can do this the same way we handle other imports by adding this line in our Python file:
import numpy
Often times, libraries are imported under an alias, or an alternate name. For example:
import numpy as np
Throughout the rest of this tutorial, I will be referring to NumPy as np.