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

The datetime, day, and time objects

The datetime object is part of the datetime library and not a part of pandas. This class can be utilized to construct objects representing several common patterns such as a fixed point in time using a date and time, or simply a day without a time component, or a time without a date component.

The datetime objects do not have the accuracy needed for much of the mathematics involved in extensive calculations on time-series data. However, they are commonly used to initialize pandas objects, with pandas converting them into pandas timestamp objects behind the scenes. Therefore, they are still worth a brief mention here as they will be used frequently during initialization.

A datetime object can be initialized ...

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