课程: Hands-On Advanced Python: Data Engineering Basics
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Sorting data
- [Instructor] It is probably not a surprise to you that sorting is one of the most common data operations, and that's what we're going to take a look at in this video. So let's open up the sortingdata starting point. And you can see here in the starting point code that I've already used the filter function which we saw used in a previous video in the chapter to create a subset of the larger weather data that only includes days on which there was snowfall. So this is going to give us a much more manageable set of data to work with in this example. There's a couple of different ways to sort data in Python using functions that are built into the language that don't require a third-party library like Pandas or NumPy. The first is to use the top-level sorted function which takes an iterable object and creates a new sequence of sorted data. So let's try that one first. And I'm going to call that sorted_dataset. And I'm going to…