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

免费学习该课程!

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

Basic data operations

Basic data operations

- [Instructor] So now that we've seen how to load and parse the dataset, let's try some hands-on basic data operations. So for example, let's find out which day had the warmest temperature in the entire dataset. So here in my editor, I'll open up basicdata.py, and you can see that I've already imported the JSON and pretty print modules, and I've already got the code to open the file, and I'll be doing that through the rest of the course. There's no sense in making you type that each and every time. All right, so to find out the warmest day, we're going to use the max function which returns the largest value within a set of data. So I'll have my warmday variable, and that's going to be the result of max, and I'm going to find the maximum value in the weather data. Now I need to specify which value in the weather information object that I'm interested in. Since we want the warmest day, I'm going to use the tmax field, and…

内容