1. Learn
  2. /
  3. Courses
  4. /
  5. Streamlined Data Ingestion with pandas

Connected

Exercise

Load entire tables

In the last exercise, you saw that data.db has two tables. weather has historical weather data for New York City. hpd311calls is a subset of call records made to the city's 311 help line about housing issues.

In this exercise, you'll use the read_sql() function in pandas to load both tables. read_sql() accepts a string of either a SQL query to run, or a table to load. It also needs a way to connect to the database, like the engine in the provided code.

Instructions 1/2

undefined XP
  • 1

    Use read_sql() to load the hpd311calls table by name, without any SQL.

  • 2

    Use read_sql() and a SELECT * ... SQL query to load the entire weather table.