Welcome back.
We learned about Pandas and Matplot library.
Now let's do a mini project.
Analyze a real data set.
Let's load and analyze a real CSV file from online resource.
By the way, you can upload any Excel sheet, any spreadsheet.
Here to the files and link it, but I prefer using online things online URLs.
Here we're going to load data from URL, explore it and visualize the results.
Go to Google type demo CSV file online.
There are a lot of websites that gives you free CSV files like this website.
Don't click on it because it will download it.
We need to copy the link, so copy link from here.
Go to this cell and paste the name.
Also you can check other sample files, but I prefer this GitHub.
In order to do that, we need an online data set.
So data URL equals this string DF data frame equals to PD Panda.
The pandas a powerful data analysis and manipulation library for Python.
As we talked about it in the previous videos.
Dot read key.
So here we are reading a CSV from a data URL.
Then we need to use this to display it.
Run the cell and here we go.
We have John Doe and other, but there are no column names.
Because this file doesn't contain any column name.
Go to GitHub.
Search for sample CSV files.
This is good repository github.com slash data.
Sample CSV files.
This is a good one.
You can get the description for the files.
For example index country email I need to get CSV files with numeric values in order to calculate the
mean and do other jobs on it.
So here we have people schema.
We have organizations products and others okay.
So you can select products copy link from here.
Also you can download it by clicking on it.
Open it with Excel.
And here we go.
We have index name description brand category, price currency stock and others okay we need to calculate
the average price.
So let me copy this link address and paste it here.
Then run this cell and the data is being visualized okay.
So this is how to load data from online CSV file.
Again guys you can upload your CSV files here and copy the link to to to to directly visualize them.
Now let's visualize the data with our Matplot library.
Here we have many columns we need to get the numeric ones.
I love using the price and also you can use the stack and get the index.
Okay so you can use the stack.
Let's start with print average stack.
Print df dot mean.
And we need to use the numeric values only.
Actually not visualizing the data like statistics run.
And here we go.
We have the index the price the stock internal ID and data type.
So those are the statistics of the data.
You can get the average for the numeric values index because index is an integer, you don't need this.
The stock, the price.
Those are very useful.
Now let's visualize the data.
Let's let's plot the stocking price.
So here we have plt dot figure figure size.
We need to get the figure size ten by six.
It's good plt dot plot.
Here we need to define the values and the the numeric things that we need to display.
So def and what things we need to display.
We need to display the stock price okay.
Marker equals to oh color blue line width equals to two.
The title would be stock price Y label is price.
The plot dot grid equals to true and plot dot show.
We need to call this function.
Let's run and here we go.
This is the stock price.
You can notice that the we have 100 company and the stock price is from 0 to 1000.
You see that for example the company number 20 the stock price is below 200.
If we go up to the to here we need to get all the tabular format.
And the company number 20.
The stock price is one six $3 $163 okay.
So it's below 200.
So this data visualization is real.
And it's very very helpful for statistical things for data analysis, for machine learning and others.
So we're going to use those libraries in the next videos.