NumPy Tutorial · NumPy Tutorial

NumPy Getting Started

Learn all about NumPy Getting Started in this comprehensive tutorial.

5 min read intermediate
  • If you have Python and PIP already installed on a system, then installation of NumPy is very easy.
  • Once NumPy is installed, import it in your applications by adding the import keyword:
  • NumPy is usually imported under the np alias.
  • The version string is stored under __version__ attribute.

Installation of NumPy

If you have Python and PIP already installed on a system, then installation of NumPy is very easy.

Install it using this command:

python

If this command fails, then use a python distribution that already has NumPy installed like, Anaconda, Spyder etc.

Import NumPy

Once NumPy is installed, import it in your applications by adding the import keyword:

python

Now NumPy is imported and ready to use.

python

NumPy as np

NumPy is usually imported under the np alias.

Note: alias: In Python alias are an alternate name for referring to the same thing.

Create an alias with the as keyword while importing:

python

Now the NumPy package can be referred to as np instead of numpy.

python

Checking NumPy Version

The version string is stored under __version__ attribute.

python

Module quiz

2 questions
1

Which of the following is true about NumPy Getting Started?

2

What is the most common pitfall when working with NumPy Getting Started?

Answer all questions to submit.