11 Working with dates and times
This chapter covers
- Converting
Series
of strings to datetimes - Retrieving date and time information from datetime objects
- Rounding dates to week, month, and quarter ends
- Adding and subtracting datetimes to and from each other
A datetime is a data type for storing date and time. It can model a specific date (such as October 4, 2021), a particular time (such as 11:50 a.m.), or both (such as October 4, 2021 at 11:50 a.m.). Datetimes are valuable because they allow us to track trends over time. A financial analyst may use datetimes to determine the weekdays when a stock performs best. A restaurant owner may use them to discover the peak hours that customers are patronizing the business. An operations manager may ...
Get Pandas in Action now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.