Generating insights using data filtering and aggregation

Reading CSV files and selecting multiple columns is easy with pandas. In this section, we will take a look at how to slice and dice data, essentially filtering data with pandas.

Getting ready

In this section, we will use the same set of libraries (the following ones) that we used in the previous recipe:

  • pandas for filtering and data analysis
  • matplotlib and seaborn for plotting charts and saving the data in a PDF file

How to do it...

  1. Let's start by importing the required libraries and reading the CSV file with the read_csv() method. The following code carries out the operations:
     import pandas as pd from matplotlib import pyplot as plt import seaborn as sns'default') pd.set_option('display.line_width', ...

Get Automate it! - Recipes to upskill your business now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.