Working with Date and Datetime Data
Explore how to use Python's datetime library and pandas to work with date and datetime data. Learn to convert and extract date features, perform date operations, and set datetime indices for easier time series data filtering and analysis.
We'll cover the following...
We'll cover the following...
The datetime library
The basic Python package datetime (again, in lowercase) is specifically created to work with dates and times. It helps with things such as adding time intervals to dates (like adding X weeks to a date), extracting the month or day from a date, and working with time zones.
Objects and methods
date: Allows us to work with a date object.datetime: Like the date object, but also includes a time stamp if we need to go into hours, minutes, etc.timedelta...