NumPy
When handling data, we often need a way to work with multidimensional arrays. As we discussed previously, we also have to apply some basic mathematical and statistical operations on that data. This is exactly where NumPy positions itself. It provides support for large n-dimensional arrays and has built-in support for many high-level mathematical and statistical operations.
Note
Before NumPy, there was a library called Numeric. However, it's no longer used, because NumPy's signature ndarray allows the performant handling of large and high-dimensional matrices.
Ndarrays are the essence of NumPy. They are what makes it faster than using Python's built-in lists. Other than the built-in list data type, ndarrays provide a stridden view of memory (for example, int[]
in Java). Since they are homogeneously typed, meaning all the elements must be of the same type, the stride is consistent, which results in less memory wastage and better access times.
The stride...