Activity 3.01 – using SQL data for pandas analytics
As the data analyst at a supply company, you have been provided with a list of customers and orders for Q4 2020. The data is present in some tables in a database named supply_company.db
, and you have been asked by the sales team to identify the largest purchasing customer for Q4.
Note
You can find the code for this activity at https://github.com/PacktWorkshops/The-Pandas-Workshop/tree/master/Chapter03/Activity03_01.
Follow these steps to complete this activity:
- For this activity, you will only need the
pandas
andsqlite3
libraries. Load them into the first cell of the notebook. - Get the list of tables that are contained in the
supply_company.db
file. The database can be downloaded from https://github.com/PacktWorkshops/The-Pandas-Workshop/blob/master/Chapter03/datasets/supply_company.db. - Use a pandas SQL method to load the table that contains the orders into a DataFrame.
- Determine the number of customers...