 Oh, there we go. Okay, so we are continuing with pandas. So I'd recommend at the first, for now, you watch us as we type, and then when it comes time to exercise your work because we're gonna be typing fast and I don't think you can keep up where this is more a demo than a type along right now. So with that being said, where's our starting point? So we first wanted to demonstrate some extra data frame properties, which was the merging of data frames. Is that correct? Yeah. Okay, so a merge, if you know the concept from SQL or things like that, it will make sense, but let's show what it is visually. So we're using the runner examples. So import pandas. So this is from yesterday just. And this is the runner. Right, okay, yes. And if we run this, what do we see? It's also printed. There we go. So we see runners with distance and time. So if we scroll down a little bit under the, working with data frames, we see an age data frame, which has different for each runner it has the age. So notice the runner column is the same among both of them. So we want to match up these datas and connect. Oh, Gerardo, can you close the sidebar? Yes. Okay, okay, there we go. Okay, so what happens when we merge them? So we take the parent data frame and what we want to add to it is age. We say we connect age to it and the runner column is the thing that matches up. And if we run this, we see. Does it return it directly? Yes, it does, okay. So this returns it directly. It probably doesn't modify the original data frames, but we see now age has been connected to the runners everywhere it should be. And yeah, that's the idea of merge. And there's all kinds of these tools that you can find in Pandas to do almost everything you can. I mean, it's the same kind of tools you'd find in other things like SQL and so on. But if you ever find yourself going in manually, doing this kind of data processing thing, connecting tabular or tidy data, then maybe take a step back and see should we be doing it with Pandas instead? So our next demo is about time series. So what does this mean? So a time series is something where there is data which occurs periodically over time. And this is one of the original major use cases of Pandas. So it has pretty good support there. So first we will load this CSV file from the web which has information on all the Nobel Prize winners. So when we run this, we can see something. And we see there's, well, like we expect first name names, born, died, born country, all these kinds of things. So the thing is that these born and died columns, it looks like dates to us, but the computer doesn't interpret them as dates. So we can tell Pandas this should be a date time column. So there's this next little bit here we can copy. There we go. And if we run this and then do a head of the Nobel Prize, Nobel Prize again. So it looks pretty similar, but if we do an info now, Nobel.info. So notice that born, died, and year, they're all now date times 64 objects, which means, so before they were object like the other ones. So that means Pandas knows that these are actually date time objects. And under the hood, these are actually numpy types. So we can do some extra things now. So for example, if we do, for each of these date time columns, there's a dot DT attribute, which means interpret this as a Python date time. And we can do things like day. Let's see. And it tells us, oh, it's the day of the month. It's the integer of the day out of there. We can do year. Yeah, that looks okay. And even things like weekday, which this comes from the Python date time object. And I guess that will also define what it actually means in there. So it's like, it's Sunday, Monday, Tuesday, and so on. Yeah, but we'll just end it as a number. Yeah. So since these are date times, we can do things like arithmetic on them. So the next thing down here is how we can subtract them. So we're subtracting the born and died years, converting it to days, dividing that by 365 to make years, and then rounding it to by one. So I guess we want to run noble.head or something like that. Yeah, okay, yeah. Because this just added a lifespan column. Oh, and somewhere there, there's probably lifespan. That's the last one. That seems pretty reasonable looking. So what do we do with this lifespan now? So we have an integer lifespan. So we can do things like plot, like make plots out of it. So for example, let's make this histogram. So column lifespan, we specify some bin size and so on. And okay, yeah, looks like reasonable ages for relatively well off people from the last century. And next off, let's do something else. So since we have a column that specifies what category of price they've got, there's all kinds of things built in like plotting the lifespan split up by category. Okay, so how does this look? Yeah, I mean, seems pretty reasonable. The statistics are not that great. So I don't think you can actually draw inferences, but you see some interesting data. Okay, so we're about to go to exercises here, these exercises three. And what have we learned then? So basically by using pandas the way it's made by converting things to the right data types and aligning all the columns, making them tidy, there's all these different powerful things we can take and use which let us do things very quickly. But remember like what I said back at the beginning. So almost every time I do something medium level in pandas, I do a web search to figure out how I do it because I can't keep it all in my mind. I know the basics like slicing stuff and so on. So just keep that in mind. If it seems hard, just take the time, read about it. And the more you use it, the better you'll get at it. Okay, what do you think? Should we go straight there? Yeah, let's just go to, I mean, I don't have anything special to add. It's the same for me. I'm always checking how to do things in pandas rather than remembering. And this goes for basically any library in Python I get. It's usually you don't remember how to do any complicated operations you check. It's just so many things you can do with these libraries. Okay, yeah. There's a good question coming up. Can we say something about the difference between pandas and ours tidyverse? So, you know, do you know much about ours tidyverse? Not that much. I mean, it's a, if you know more. I propose we go to the exercises. Maybe we can have someone comment a little bit more after the exercises. So, yeah. Okay, let's go. So how long were the exercises supposed to be? 20 minutes or 15 minutes? 15 minutes. Okay. 25, and then we come back. Okay, right? I switch to the notes and see you soon. Bye. Hello, we're back. So, yes, if we look here, we see some good questions in the notes. There's this one about the difference between pandas and ours tidyverse. And thus instructors talking, we thought a good metaphor is that pandas is like what art does itself. Entityverse is a collection of many things around that, like a consistent ecosystem of stuff that works together. And that's sort of like sci-pi in Python. But really the philosophy is very similar of a bunch of stuff consistently trying to work together. There's some compatibility between them, like in the data formats, which we might talk about a little bit later today. Okay, there is various. So one thing maybe to raise is because there are these two functions for accessing columns and rows, lock and add, which we did mention yesterday really quickly, but lock gets you data, but it doesn't allow you to set data. And add allows you to set the data so that, so if you try to say database.lock and then equals something, it will give you an error. And then you should, I guess the error message doesn't tell you to use add. So you need to remember to use add, just a little bit annoying, it's something you need to remember. Yeah, okay. So there is a little bit more in pandas down at the bottom beyond the basics. It's probably not worth us trying to go into the details here, but basically the idea is you can do a whole lot here. There's, depending on what you want, you can either get more power or you can get more optimized, like faster and so on. And yeah, I mean, maybe that's all we've got. And remember, if this seems remotely useful do you read the 10 minute introductions to pandas and get this perspective? Yes, okay. Should we call it good and go to the next part then? Yeah, let's move on.