Week 13 • Tuesday

Block 123: pandas ↔ SQLite Integration

Move data between pandas DataFrames and SQLite.

Concepts

Code Examples

See exercise below.

Exercise

Load a CSV into a SQLite table via pandas. Query with pd.read_sql. Write a SQL query with GROUP BY and compare the result to a pandas groupby.

Homework

When would you choose SQL aggregations over pandas groupby? Give 2 scenarios for each.