!pip install duckdb jupysql --quiet
Test DuckDB
features based on quarto
.
All the code below can be copied and executed in a jupyter notebook.
Install dependencies
Basic configuration
import duckdb
= duckdb.connect() conn
jupysql configuration
%load_ext sql
%config SqlMagic.autopandas = True
%config SqlMagic.feedback = 0
%config SqlMagic.displaycon = True
%config SqlMagic.displaylimit = 10
%sql conn --alias duckdb-native
Demo data
Refer to Jupyter Notebooks
%%sql --save short_trips --no-execute
*
SELECT 'https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2021-01.parquet'
FROM < 6.3 WHERE trip_distance
Skipping execution...
%sqlplot histogram --table short_trips --column trip_distance --bins 10 --with short_trips