Solution 3.1
Perform the following steps to complete the activity:
- Load the
pandas
andsqlite3
libraries in the first cell of the notebook:import pandas as pd import sqlite3
- Get the list of tables present in
supply_company.db
. The database can be downloaded from https://github.com/PacktWorkshops/The-Pandas-Workshop/blob/master/Chapter03/datasets/supply_company.db:tables = pd.read_sql("SELECT name FROM sqlite_master WHERE type = 'table'", Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â sqlite3.connect('../datasets/supply_company.db')) tables
Note
Please change the path of the dataset file (highlighted) based on where you have downloaded it on your system.
This produces the following result:
- Use a pandas SQL method to load the table containing the orders into a DataFrame, as...