NumPy Tutorial

NumPy (Numerical Python) is an extension library for the Python language that supports a large number of dimensional arrays and matrix operations. In addition, it also provides a large number of mathematical function libraries for array operations.

NumPy's predecessor, Numeric, was originally developed by Jim Hugunin and other collaborators. In 2005, Travis Oliphant combined the features of another library of the same nature, Numarray, into Numeric, and added other extensions to develop NumPy. NumPy is open source and is maintained and developed by many collaborators.

NumPy is a very fast mathematical library, mainly used for array calculations, including:

  • A powerful N-dimensional array object ndarray
  • Broadcasting functions
  • Tools for integrating C/C++/Fortran code
  • Functions such as linear algebra, Fourier transform, random number generation, etc.

What You Need to Know Before Learning This Tutorial

Before we start learning the NumPy tutorial, we need to have a basic foundation in Python. If you are not yet familiar with Python, you can read our tutorials:


NumPy Applications

NumPy is usually used together with SciPy (Scientific Python) and Matplotlib (plotting library). This combination is widely used as a replacement for MatLab. It is a powerful scientific computing environment that helps us learn data science or machine learning through Python.

SciPy is an open-source Python algorithm library and mathematical toolkit.

The modules included in SciPy are optimization, linear algebra, integration, interpolation, special functions, fast Fourier transform, signal and image processing, ordinary differential equation solving, and other computations commonly used in science and engineering.

Matplotlib is a visualization interface for the Python programming language and its numerical mathematics extension package NumPy. It provides an application programming interface (API) for embedding plots into applications using common GUI toolkits such as Tkinter, wxPython, Qt, or GTK+.


Related Links

Other Extensions