Introducing advanced tricks with pandas DataFrame
pandas is an open source Python library that provides tools for high-performance data manipulation to make data analysis quick and easy. The typical uses of the pandas library are to reshape, sort, slice, aggregate, and merge data.
The pandas library is built on top of the NumPy library, which is another Python library that is used for working with arrays. The NumPy library is significantly faster than traditional Python lists because data is stored at one continuous location in memory, which is not the case with traditional lists.
The pandas library deals with three key data structures, as follows:
Series
: This is a single-dimensional array-like object that contains an array of data and an array of data labels. The array of data labels is called anindex
. Theindex
can be specified automatically using integers from 0 to n-1 if not explicitly specified by a user.DataFrame
: This is a representation of tabular data...