Whats Numpy?
Well, Numpy is one of the most popular python library that provides scientific computational and mathematical features and operations on objects like arrays, matrices, etc. Its widely used in field of data science and machine learning applications.
Installation and pre-requisites
The only pre-requisite for installing Numpy is python itself. Numpy can be installed using two package managers:
- Using Anaconda's conda
- Using python's pip
Note: Make sure your device is connected to the internet through wifi or ethernet
Method 1: using conda
If you use conda, you can install NumPy from the defaults or conda-forge channels: Execute the below commands in you conda shell ๐
# Best practice, use an environment rather than install in the base env
conda create -n my-env
conda activate my-env
# If you want to install from conda-forge
conda config --env --add channels conda-forge
# The actual install command
conda install numpy
Method 2: using pip
If you use pip, you can install NumPy with:
pip install numpy
Step 1: Open terminal or bash shell or command prompt
Step 2: paste the above command and hit enter.
TROUBLESHOOTING
If your installation fails with the message below, see Troubleshooting ImportError.
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! Importing the numpy c-extensions failed. This error can happen for different reasons, often due to issues with your setup.