课程: Hands-On Advanced Python: Data Engineering Basics

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Working with dates

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

内容