NumPy is the fundamental package for machine learning with Python. It offers powerful tools including the following:

  • The N-dimensional array ndarray class and several subclasses representing matrices and arrays
  • Various sophisticated array functions
  • Useful linear algebra capabilities

Installation instructions for NumPy are at Alternatively, an easier method is installing it with pip in the command line as follows:

pip install numpy

To install conda for Anaconda users, run the following command line:

conda install numpy

A quick way to verify your installation is to import it in the shell as follows:

>>> import numpy

It's installed nicely if there's no error message.

Get Python Machine Learning By Example - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.