Related recommendation: Python Basic Course
NumPy, whose full name is Numeric Python, is an open source Python scientific computing library, including:
A powerful n-dimensional array object narray; ;
Relatively mature (broadcast) function library;
Toolkit for integrating C/C++ and Fortran codes;
Practical linear algebra, Fourier transform and random number generation function.
Advantages of NumPy:
For the same numerical calculation task, it is much more convenient to use NumPy than to write Python code directly.
The storage efficiency and input-output performance of arrays in NumPy are far superior to the equivalent basic data structure in Python, and the performance it can improve is proportional to the elements in the array.
Most of the code of NumPy is written in C language, and its underlying algorithm has excellent performance in design, which makes Numpy much more efficient than pure Python code.
Of course, NumPy also has its shortcomings, because NumPy uses memory mapping files to achieve the best data reading and writing performance, and the size of memory limits its processing of TB-level large files; In addition, NumPy arrays are not as universal as the list container provided by Python. Therefore, in areas other than scientific computing, the advantages of NumPy are not so obvious.