WEBVTT

00:00.080 --> 00:00.880
Welcome back.

00:00.920 --> 00:05.240
We succeeded in getting data, set info and basic statistics.

00:05.280 --> 00:07.960
Now let's learn about filtering data.

00:08.160 --> 00:11.200
You can filter rows based on conditions.

00:11.200 --> 00:19.880
So for example, if we want to get all students with a grade greater than 85, we use high scores variable

00:19.880 --> 00:21.920
equals to DF.

00:22.200 --> 00:25.400
And inside this angled bracket another DF.

00:25.640 --> 00:28.160
And what is the key is the grade.

00:28.320 --> 00:31.160
And the value is greater than 85.

00:31.160 --> 00:35.720
So this line of code performs boolean indexing.

00:35.720 --> 00:41.640
It filters the data frame to select only rows where the grade is greater than 85.

00:42.000 --> 00:50.720
So this creates a Boolean series true or false values by comparing each value in the grade column with

00:50.760 --> 00:51.560
85.

00:51.680 --> 00:55.480
Okay, so let me run and see the results.

00:55.560 --> 00:56.360
Here we go.

00:56.560 --> 01:06.280
Another table another data frame called high scores or high scores containing Bob and Diana that have

01:06.440 --> 01:09.000
grades greater than 85.

01:09.200 --> 01:14.000
So both Bob and Diana have grades greater than 85.

01:14.000 --> 01:24.880
So this is our filtered data, the new filtered data frame based on conditions that the grade greater

01:24.880 --> 01:26.200
than 85.

01:26.520 --> 01:35.000
This uses the Boolean series to filter the data frame, keeping only rows where the condition is true.

01:35.200 --> 01:42.320
Okay, so this is how filtering data works in data frames and in pandas.
