Welcome back.
We succeeded in getting data, set info and basic statistics.
Now let's learn about filtering data.
You can filter rows based on conditions.
So for example, if we want to get all students with a grade greater than 85, we use high scores variable
equals to DF.
And inside this angled bracket another DF.
And what is the key is the grade.
And the value is greater than 85.
So this line of code performs boolean indexing.
It filters the data frame to select only rows where the grade is greater than 85.
So this creates a Boolean series true or false values by comparing each value in the grade column with
85.
Okay, so let me run and see the results.
Here we go.
Another table another data frame called high scores or high scores containing Bob and Diana that have
grades greater than 85.
So both Bob and Diana have grades greater than 85.
So this is our filtered data, the new filtered data frame based on conditions that the grade greater
than 85.
This uses the Boolean series to filter the data frame, keeping only rows where the condition is true.
Okay, so this is how filtering data works in data frames and in pandas.