Data Science Jumpstart with 10 Projects Transcripts
Chapter: Project 6: Working with Time Series - Air Quality over Time
Lecture: Make a Function to Clean up Pandas Data

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Our next section is making this chain that we just created into a function.
0:05 I've already talked about making functions, but again, I think this is super important. That's why I keep repeating it.
0:11 So here's loading our raw data up here. And down here is a function that I've created. I've just taken that chain and wrapped it into this function.
0:19 And let's run that. That looks like it worked. Now, what I like to do is move this to the top. And I'm going to actually restart my kernel here.
0:29 And we'll rerun this and run this down here. And you can see that that worked.
0:33 With two cells executed, I have loaded my data and I've actually cleaned up my data. And I tested it. I restarted my kernel and it worked.
0:43 Highly recommend you write these functions. I also highly recommend that you put them at the top of your notebook once you have them.
0:50 It's just going to make your life a lot easier.


Talk Python's Mastodon Michael Kennedy's Mastodon