O'Reilly logo

Python Data Analysis by Ivan Idris

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

pandas DataFrames

A pandas DataFrame is a data structure, which is a labeled two-dimensional object and is similar in spirit to an Excel worksheet or a relational database table. A similar concept, by the way, was invented originally in the R programming language. (For more information, refer to http://www.r-tutor.com/r-introduction/data-frame.) A DataFrame can be created in the following ways:

  • From another DataFrame.
  • From a NumPy array or a composite of arrays that has a two-dimensional shape.
  • Likewise, we can create a DataFrame out of another pandas data structure called Series. We will learn about Series in the following section.
  • A DataFrame can also be produced from a file, such as a CSV file.

As an example, we will use data that can be retrieved ...

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