Introduction
Linear Algebra Basics
Array Fundamentals
Working with multidimensional arrays
Our example dataset and basic plotting
ndarray methods
Array Axes
Vectorized Computing
Universal Functions (ufuncs)
Advanced array manipulation
Randomness
Selected Topics in Mathematics and Statistics

What is an array?

At the core of NumPy are arrays. Let’s formally define what an array is:

array
A data structure with elements of the same type whose position can be accessed by one or more indices. Hence, a programming language implementation of a vector, a matrix, or a tensor is an array.

Given this broad definition of arrays, Python has two built-in types that resemble an array: the list and the tuple. We could use a list of lists or a dictionary of lists to store multiple lists, effectively creating multidimensional arrays. However, neither the list, the tuple, nor the dictionary is optimized for numerical purposes. They don’t even adhere to our definition that well since they can store values of different types. E.g., a list can contain a mixed collection of numbers, strings, and any other object type.

NumPy solves many of the Python shortcomings regarding numerical computation through arrays. Array creation and manipulation in NumPy are blazing fast and well-optimized. NumPy arrays are implemented in C, bypassing any speed limitations that Python might have.