A data frame is a two-dimensional table with labeled rows and columns. In Python workflows, pandas provides an in-memory data frame that DuckDB can query as though it were a relational table. section 6.3 section 6.0
Data frames support several practical workflow patterns:
- Load structured values into pandas, then query them with SQL-like filters through DuckDB. section 6.3
- Use DuckDB to access pandas or Polars data directly without copying the in-memory representation. section 1.3
- Return query results as data frames for continued pandas analysis or visualization with Python libraries. section 1.7.4 section 6.3
- Pass data frames into pipeline assets and persist their contents as DuckDB tables. section 8.4.4
Querying an authors data frame
Create a pandas data frame named people with name and country columns, then run `SELECT * FROM people WHERE country = 'Germany'`. DuckDB returns the two matching authors. A parameterized query can return rows outside Germany, while `fetchdf()` returns the result as another data frame rather than a DB-API cursor. section 6.3
Using a data frame in an application pipeline
A Dagster asset builds a pandas data frame describing tennis tournament levels and creates a DuckDB table from it. A Streamlit application likewise returns query results as a data frame and renders them as an interactive table. section 8.4.4 section 9.1.3
people = pd.DataFrame({
"name": ["Michael Hunger", "Michael Simons", "Mark Needham"],
"country": ["Germany", "Germany", "Great Britain"]
})
Shows a compact pandas constructor for creating a labeled data frame with author names and countries. section 6.3


















