-: So attached to this video will be a link to a CSV file.
Make sure to download that file.
It's called students.csv.
If we have a look at this,
and I'm gonna go and open this up,
you can see we have some data about students.
So for example, the first name, the last name,
the gender of a student, the age, the grade level,
and some other things such as what type of degree they took,
their attendance rates,
their extracurricular activities, et cetera.
We're gonna use ChatGPT to analyze this dataset
rather than having to use Excel.
Cool, so the first thing is once you've got
that downloaded, go to ChatGPT.
I want you to click on this plus sign,
click from Upload from computer, go to students.csv.
You can also drag the CSV or any file directly
into the chat box as well.
That's also possible.
Then we're gonna say,
can you find out how many students
there are in this dataset?
And what it will do
is ChatGPT will analyze and write code
and you'll see if you click on this Analyzing,
you can see that it's actually going
and generating some code in Python
and it's returning a result.
And then it shows you there are 50 students in the dataset.
So ChatGPT has a way of being able to run code for you
in Python, execute that code,
and then return the answer of that to you
in natural language.
We could say how many males versus females
are there in the CSV?
And again, it's running some Python code.
You don't always have to show the details of this.
You can hide it, but I quite like to see exactly
what's been happening.
So you'll see here it actually ran into an error.
See there's this KeyError Gender
and then it's decided to print out the columns
so that it can specifically figure out
which columns it needs to query.
It then creates a new specific piece of code.
And you can see here,
it is doing a .value_counts on the gender,
which allows it to find out
that there's these 25 females and 25 males.
If we scroll up and have a look at the dataset,
we could also say which major
has the highest attendance rate?
So now it's deciding to group it
by the major and it's using the attendance rate
and getting the mean of that.
And then it finds the one that has the highest maximum.
So math had the highest attendance rate,
and so you can see
that we don't necessarily need to put this data
directly into Microsoft Excel.
We can just put a CSV directly
inside of ChatGPT and start asking it
natural language questions.
We can even plot bar charts.
So I can say, can you plot
a bar chart of attendance rates, broken down by major?
And now it's decided to use a plotting library.
So this is just a piece of code
that allows it to generate graphs dynamically.
So we'll just wait for that to load.
And here you go, here's your bar chart,
and you can easily download this or change this.
You can click on this Download chart
and then you can download that directly to your desktop.
You can also click on, right click,
and then Save Image As if you're on Mac.
So it's possible for you to not only ask questions
in the natural language,
but get automatic data visualizations
made out of ChatGPT.
As an exercise,
I want you spend two minutes asking ChatGPT
some follow-up questions on this dataset,
and also playing around with
what kind of data visualizations you can get it to create.
Cool, I'll see you in the next one.