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)

Calculating new dates using offsets

Frequencies in pandas are represented using date offsets. We have touched on this concept at the beginning of the chapter when discussing Timedelta objects. pandas extends the capabilities of these using the concept of DateOffset objects. They are objects which represent knowledge of how to integrate time offsets and frequencies relative to DatetimeIndex objects.

Representing data intervals with date offsets

DatetimeIndex objects are created at various frequencies by using passing frequency strings such as 'M', 'W', and 'BM' using the freq parameter of pd.date_range(). Under the hood, these frequency strings are translated into an instance of the pandas DateOffset...