From the course: Hands-On Advanced Python: Data Engineering Basics
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Working with dates - Python Tutorial
From the course: Hands-On Advanced Python: Data Engineering Basics
Working with dates
- [Instructor] Almost nobody likes having to work with dates and times. And there's a lot of reasons for this. Dealing with time zones and leap years and performing calculations on date and time values, these are not exactly high on the list of most developers' ideas of fun. Now thankfully Python makes this process a little easier because it includes a module for working with these data types as a part of the standard library. And in this example we're going to use that module to perform some basic date-related operations. Now remember that each item in our dataset contains a date that corresponds to the days' weather information. So let's take a look, and remember, let me scroll the way up to the top here. So we've got this date that's attached to each one of the weather data items for our day. Now we can use this date time module to convert this string into a date object fairly easily. So let's open up our date ops PY code.…