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, which is very important to be aware of: Index. However, in order to understand the pandas data structures, we need to take a look at NumPy, which provides the n-dimensional arrays that pandas builds upon.

For the remainder of this book, we will refer to DataFrame objects as dataframes, Series objects as series, and Index objects as index, unless we are referring to the class itself.

The aforementioned data structures are created as Python classes; when we actually ...

Get Hands-On Data Analysis with Pandas now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.