Difference between Numpy and Pandas

1. The difference between
Numpy: It is an extension package for numerical computing, which can efficiently handle N-dimensional arrays, complex functions, and linear algebra.

Panadas: It does data processing. A data analysis package for python,
2. Introduction
1) NumPy: N-dimensional array container

Numpy is specially designed for ndarray operations and operations, so the storage efficiency and input and output performance of arrays are far superior to nested lists in Python. The larger the array, the more obvious the advantages of Numpy. The Numpy system is an open source numerical computing extension to Python. This tool can be used to store and process large matrices much more efficiently than Python's own nested list structure (which can also be used to represent matrices). NumPy is said to turn the Python equivalent of a free and more powerful MatLab system.
1. Advantages of ndarray

NumPy provides an N-dimensional array type ndarray, which describes a collection of "items" of the same type.

1. Memory block style:

This is because all elements in an ndarray are of the same type, and the element type in a Python list is arbitrary, so the memory of ndarray can be contiguous when storing elements, while python's native lis can only be found by addressing. One element, although this also causes Numpy's ndarray to be inferior to Python's native list in general performance, but in scientific computing, Numpy's ndarray can save a lot of looping statements, and the code usage is much simpler than Python's native list.

2. ndarray supports parallelized operations (vectorized operations)

3. The bottom layer of Numpy is written in C language, and the GIL (Global Interpreter Lock) is released internally. Its operation speed on arrays is not limited by the Python interpreter, and its efficiency is much higher than that of pure Python code.


2.Pandas: The table container
pansdas is a tool based on Numpy, which was created to solve data analysis tasks. Pandas incorporates a large number of libraries and some standard data models, providing the tools needed to efficiently manipulate large datasets. pandas provides a large number of functions and methods for working with data quickly and easily. One of the important factors that makes Python a powerful and efficient data analysis environment.
---------------------
Original: https://blog.csdn.net/weixin_43407092/article/details/89575559

Related Posts