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 ...

Get Learning pandas - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.