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 by date and time using DatetimeIndex

A DatetimeIndex is used to represent a set of dates and times. These are extensively used in time series data where samples are taken at specific intervals of time. To briefly demonstrate this, the following code creates a range of 5-hourly time periods and uses them as the index for this series.

The type of the index can be seen to be a DatetimeIndex.

The underlying representation of the date/time is a 64-bit integer, making lookups by date and time very efficient.

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