Book Image

Learning pandas - Second Edition

By : Michael Heydt
Book Image

Learning pandas - Second Edition

By: Michael Heydt

Overview of this book

You will learn how to use pandas to perform data analysis in Python. You will start with an overview of data analysis and iteratively progress from modeling data, to accessing data from remote sources, performing numeric and statistical analysis, through indexing and performing aggregate analysis, and finally to visualizing statistical data and applying pandas to finance. With the knowledge you gain from this book, you will quickly learn pandas and how it can empower you in the exciting world of data manipulation, analysis and science.
Table of Contents (16 chapters)

Indexing Data

An index is a tool for optimized look up of values from a series or DataFrame. They are a lot like a key in a relational database, but more powerful. They provide the means of alignment for multiple sets of data and also carry semantics for how to handle various tasks with data such as resampling to different frequencies.

Much of the modeling that you will perform with pandas depends critically on how you set up your indexes. A properly implemented index will optimize performance and be an invaluable tool in driving your analysis.

We have previously used indexes briefly, and in this chapter, we will dive quite a bit deeper. During this deep dive, we will learn more about:

  • The importance of indexes
  • The types of pandas indexes, including RangeIndex, Int64Index, CategoricalIndex, Float64Index, Datetimeindex, and PeriodIndex
  • Setting and resetting an index
  • Creating hierarchical...