Lesson 3 ❮ Lesson List ❮ Top Page
❯ 3.5 Filtering
⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
EXPECTED COMPLETION TIME
❲▹❳ Video 7m 57s
☷ Interactive readings 5m
As we have learned before, boolean conditions can be used to filter out some conditions, both in DataFrame object and Groupby object.
We will combine that using aggregation function.
In this example, we will find the 'AIRLINE' where its average 'DEP_DELAY' is higher than the average 'DEP_DELAY' of all flights.
In Lesson 1.4, we learned that filter can be used on DataFrame object to select the necessary columns.
When the filter method is used on the GroupBy object, it will return a copy of a DataFrame excluding filtered elements.