NumPy's main object is a homogeneous multidimensional array. An array is essentially a table of elements (usually numbers), all of the same type, indexed by a tuple of positive integers. The index in NumPy arrays is zero-based, so the first element is the 0th element; the second element is the 1st element, and so on. In NumPy, dimensions are called axes and the number of axes, or dimensions, is called the rank or dimension of the array. To import NumPy into our Jupyter Notebook, we use the numpy as np convention import.
NumPy arrays
Creating arrays in NumPy
There are the following two methods to create arrays in Python:
- Creating arrays from lists
- Using the built-in functions that NumPy provides