Click here for transcript of Sorting Data.
PRESENTER: In this video, I'm going to give you some tips for how to organize your data to make the plotting in this problem set easier. So your data file probably looks like this. This is just a text file. And for each earthquake, in the row, there's a bunch of information about it. There's the day that it happened. There's the time, the latitude, the longitude, the depth, the magnitude, and then some text information.
So what you want to do is just grab out the magnitudes, because we don't really care about anything else at all in this. Just to make our plot, all we want is the magnitudes. So I use [INAUDIBLE], but you can use something else, or nothing, if you'd rather just work with this entire big data file. So I make a new file that just has the magnitudes in it, and here it is. So here's all the magnitudes in order.
And now I'm just going to use Control-A to copy the whole file-- or select the whole file and then Control-C to copy it. And I'm going to open up a spreadsheet document. I use Numbers, because I'm a Mac user, but it's very similar to Excel. So if you're used to that, this is going to look normal to you. And then I'm just going to paste in the contents of that file right into this spreadsheet with Control-V. And there are all my earthquakes.
So they're all sitting here in this column now. And the thing I'm going to do to make my life easier is I'm going to choose to sort them in descending order, having the largest magnitude earthquake moves into spot number one-- it's a 4.3-- and the smallest one moves into the spot in the bottom. I'll move this file up so you can see it better. But there's 180-some earthquakes in my catalog, and the smallest one is a magnitude 1. So there we are.
Now, there's only 180-some earthquakes in this catalog, so it's conceivable that you could count them all by hand, because you want to populate an x and y table with the magnitude and then the number of earthquakes greater than or equal to that magnitude. So it won't take you too long to count them by hand. But if you had a really, really big data file, like 20,000 earthquakes, you would not want to count them by hand, of course.
So look at how these are sorted, and see if you can think of a way to count them without doing it by hand. And if you're still stumped, then watch the next video.