O'Reilly logo

Mastering pandas by Femi Anthony

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data structures in pandas

The pandas was created by Wed McKinney in 2008 as a result of frustrations he encountered while working on time series data in R. It is built on top of NumPy and provides features not available in it. It provides fast, easy-to-understand data structures and helps fill the gap between Python and a language such as R.

A key reference for the various operations I demonstrate here is the official pandas data structure documentation: http://pandas.pydata.org/pandas-docs/dev/dsintro.html.

There are three main data structures in pandas:

  • Series
  • DataFrame
  • Panel

Series

Series is really a 1D NumPy array under the hood. It consists of a NumPy array coupled with an array of labels.

Series creation

The general construct for creating a Series ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required