Numerical Python (NumPy) is an open source Python library for scientific computing. NumPy provides a host of features that allow a Python programmer to work with high-performance arrays and matrices. NumPy arrays are stored more efficiently than Python lists and allow mathematical operations to be vectorized, which results in significantly higher performance than with looping constructs in Python.
pandas builds upon functionality provided by NumPy. The pandas library relies heavily on the NumPy array for the implementation of the pandas Series
and DataFrame
objects, and shares many of its features such as being able to slice elements and perform vectorized operations. It is therefore useful to spend some time going over NumPy arrays before diving into pandas.
In this chapter, we will cover the following topics about NumPy arrays:
Installing and importing NumPy
Benefits and characteristics of NumPy arrays
Creating NumPy arrays and performing basic array operations
Selecting...