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

Modelling an interval of time with a Period

pandas formalizes the concept of an interval of time using a Period object. A Period allows you to specify durations based on frequencies such as daily, weekly, monthly, annually, quarterly, and so on, and it will provide a specific start and end Timestamp representing the specific bounded interval of time.

A Period is created using a timestamp and a frequency, where the timestamp represents the anchor used as a point of reference and the frequency is the duration of time. To demonstrate, the following creates a period representing one month and which is anchored in August 2014:

A Period has start_time ...

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