Lesson 4 ❮ Lesson List ❮ Top Page
❯ 4.4 Advanced Filtering
4.5 Multiple Plots with Seaborn
⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
EXPECTED COMPLETION TIME
❲▹❳ Video 9m 51s
☷ Interactive readings 5m
Before we see further on plotting, we will expand our knowledge on filtering by using some useful methods that return boolean value:
series.between(left, right) Return boolean Series equivalent to left <= series <= right
series.gt(other) Return boolean Series equivalent to series > other
series.lt(other) Return boolean Series equivalent to series < other
series.eq(other) Equivalent to series == other.
series.isin(values) Return a boolean Series showing whether each element in the Series matches an element in the passed sequence of values exactly.
Pivoting is the process of converting a categorical column into headers label.
Pivoting requires three argument:
index: Column to use to make new frame’s index. If None, uses existing index.
columns: Column to use to make new frame’s columns.
values: Column(s) to use for populating new frame’s values. If not specified, all remaining columns will be used.
Using the pivot DataFrame, it becomes easier to construct multiple kinds of plots.
In this example, we will see 4 kinds of plots for categoric--bar plot, line plot, a stacked bar chart, and a stacked ratio chart. We also see how to make a histogram from one of the Series.