Many people have written Python code and shared it online, free for anyone to use. Maybe someday you do this too. It could be very cool. Very satisfying to write code shared online and see others use what you've created. Thanks to many others already having shared their code online, you can take advantage of their work by downloading and installing their packages. I will refer to these packages as third party packages because they're written by someone else. That is not by you and not by the official maintainers of the Python programming language. Today, there are at least hundreds of thousands of these third-party packages out there. In this lesson, you see some of the most popular packages developed by third parties for working with data and drawing graphs, both of which are something that I use quite a bit in my work. The packages you'll see are called Pandas and matplotlib. Let's take a look. One of the most popular Python third party packages is called Pandas, and is often used for processing structured data like kinds stored in spreadsheets and CSV files. Pandas, unfortunately, has nothing to do in this case with the cute cuddly animals. It comes from the shortening of the term panel data, which is a term from economics. You can ask an AI chatbot about it or search online if you want to know more. Although if it brings you joy to picture a bunch of cute, cuddly Pandas doing data science, feel free to have that picture in your head too. The most common way to develop this import Pandas is to use this command Import Pandas as PD. The "as pd" is something new. Let's ask the AI chatbot but what this does. What does "as" in the following code do? It turns out that if you had run import Pandas, you need to write Pandas dot and then the function name. But if you don't want to type Pandas and you want to take just pd as a shortened alias, then import Pandas as PD tells it that you want to load Pandas but called PD going forward. Feel free to pause the video and read in detail if you want. But what this lets us do is write pd dot function rather than Pandas dot function and that saves us some typing as we use functions from the Pandas package. And I wanted to mentioned this because if you ever have a chatbot write code for you that uses the Pandas package is very likely that it will import Pandas as PD. In this lesson, we use a data set on used car sales prices. The data we'll use here is adapted from a dataset at this URL due to NehalBira and others, and I'll read the data using the Pandas read csv as the function, and then we print out the data after that. My first car ever was a blue Honda Accord and we'll simplify this data to have only data from Honda models. Pandas also lets you filter important information. For instance, you can get all the costs for which the selling price is above $10,000. Pandas has a lot of different commands, and it's difficult to remember all of them, but it turns out our AI chatbot knows Pandas pretty well. Load some data using this code, we tell the AI chatbot what the data looks like and we want to show in the cars are price greater than equal to $10,000 and we run it. It says you can get the filter data using this syntax. If you're curious what this does exactly, feel free to ask the AI chatbot to explain it to you and just copy that snippet of code. And let's go back to our Jupyter notebook and say print what we got from the AI chatbot. And now this prints out the subset of cars. So the price over $10,000. However it turns out if you want to find all the cars whose year is say 2015, model year 2015, you could do that. And this prints out to cars with model year 2015. Here's something else you could do. You could say filter data equals all the cars whose year is 2015. We can also print filtered data. And we can take the filter data, look at the price of all the cars with model year 2015 and print out the median price. So that corresponds to look at all of these prices and printing out the median price of all the cars whose year is 2015. And it looks like $5475 is the median price of the cars from that year. I know I went through quite a lot of different examples here. You don't need to remember any specific line of code, because if ever you want to filter the data or compute the mean of computer median, I would encourage you to ask the AI chatbot for help. Pandas, by the way, is a very powerful tool that professional data scientists use day-to-day in their work. And it's that exact same Pandas package that you are using here in this example, Beyond manipulating data, there's another very popular package for plotting data called matplotlib. To import the plotting functions from matplotlib. The most common line of code would be this: import matplotlib.pyplot as plt. This particular package name is a little bit unusual because it has dot in the middle, but for our purposes you don't need to worry about what that means. So having imported the plt function, I can do plt create the scatter plot that plots the price versus the mileage. And if I run that, it shows a chart like this where the x-axis is the mileage in kilometers, and the y-axis is the price in US dollars. It turns out if you want to label the axes, you can add a few extra commands like this. And if I rerun that, you get a plot that looks like this. Sometimes you see developers has one more line plt dot show, which explicitly tells Python to show the plot. Let me just do that. And so here's a nice looking plot on price versus mileage. Now, one thing that you might want to do when manipulating data is change up the plot that you have. So if you want to add a grid to the plot, maybe change the scatter plot color to red and maybe increase the title font size. How do you do that? Let's ask the AI chatbot. I have the following plot command. Please add a grid, change the scatter plot color red and increase the title font size. Let's see if we can solve this for us. And I'm just going to take the code and run it and see if it works. And let me run that. And yep, change the color of the red. Add to the grid, increase the title, font size. AI chatbots don't always give you exactly the right code, but they often work quite well. So many developers will have AI chatbot write the code, take a quick look, make sure it looks kind of sensible, and then run it to see if it works. And sometimes it won't work. But if you go to the AI chatbot to tell it, hey, thanks for the code, but it didn't quite work out. The font wasn't quite right, the color wasn't what I thought. You can then sometimes get the AI chatbot to try again, and have a better chance at giving you the right answer the second time around, but here it works just fine the first time around. So in this lesson, you've tried a couple of third-party packages, the Pandas package and matplotlib packages, and you saw how you needed to import the functions first before you can use them. This import commands was very similar to what you use for built-in packages like the math package or the CSV package. As well as for functions that were saved in a file like the helper functions file. Now, with Python's built-in packages, they're already a part of Python, and you didn't need to install them. In this particular Jupyter notebook, we'd already made sure that Pandas and matplotlib were already installed, but they're also lots of third party packages that are not yet installed on your computer or in a particularly Jupyter notebook environment. So how can you get your computer to go onto the internet to download and install some brand new third party Python package? Let's go to the next lesson to see how to do that.