Pandas data structures
Python has several data structures already, such as tuples, lists, and dictionaries. Pandas provides two main structures to facilitate working with data: Series
and DataFrame
. The Series
and DataFrame
data structures each contain another pandas
data structure, Index
, that we must also be aware of. However, in order to understand these data structures, we need to first take a look at NumPy (https://numpy.org/doc/stable/), which provides the n-dimensional arrays that pandas
builds upon.
The aforementioned data structures are implemented as Python classes; when we actually create one, they are referred to as objects or instances. This is an important distinction, since, as we will see, some actions can be performed using the object itself (a method), whereas others will require that we pass our object in as an argument to some function. Note that, in Python, class names are traditionally written in CapWords
, while objects are written in snake_case
. (More Python...