The main pandas data structures – Series and DataFrame
Several classes for manipulating data are provided by pandas. Of those, we are interested in Series
and more interested in DataFrame
.
The Series
The Series
is the primary building block of pandas and represents a one-dimensional labeled array based on the NumPy ndarray
. The Series
extends the functionality of the NumPy ndarray
by adding an associated set of labels that are used to index the elements of the array. A Series
can hold zero or more instances of any single data type.
This labeled index adds significant power to access the elements of the Series
over a NumPy array. Instead of simply accessing elements by position, a Series
allows access to items through the associated index labels. The index also assists in a feature of pandas referred to as alignment, where operations between two Series are applied to values with identical labels.
The DataFrame
The Series
is the basis for data representation and manipulation in pandas,...