O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

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

Indexing using DatetimeIndex

The core of the time-series functionality in pandas revolves around the use of specialized indexes that represent measurements of data at one or more timestamps. These indexes in pandas are referred to as DatetimeIndex objects. These are incredibly powerful objects, and they allow us to automatically align data based on dates and times.

There are several ways to create DatetimeIndex objects in pandas. The following creates a DateTimeindex by passing a list of datetime objects to a Series:

This Series has taken the datetime objects and constructed a DatetimeIndex from the date values. Each value of that index is ...

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