We are now ready to start exploring NumPy, the fundamental package upon which the whole scientific Python stack is built. This chapter presents an introduction to the essential features of NumPy that are used in day-to-day scientific and data computations.
Built-in Python data structures, such as lists and dictionaries, are ill suited for scientific and data-oriented computing and their use results in programs that are significantly slower than numerical code written in compiled languages such as C, C++, and Fortran. NumPy was created to address this problem, and solves it by defining specialized array-oriented objects and methods designed for efficient numerical and data computing. The main data structure defined in NumPy with this purpose is ndarray, which represents a multidimensional array of data.
Objects of ndarray type differ from the native Python data structures...