Jupyter NoteBook

Published: (December 29, 2025 at 02:57 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

Cover image for Jupyter NoteBook

Jupyter

Here are sample code snippets from my Jupyter Notebook exploration.

Query from CSV file

You can query a CSV file directly using jupysql with the DuckDB engine.

# Install required packages
%pip install jupysql duckdb duckdb-engine

# Load the SQL extension
%load_ext sql

# Connect to DuckDB (in‑memory)
%sql duckdb://

# Execute the query
%%sql
SELECT GolonganRuang,
       AVG(Usia) AS rata_rata_usia,
       COUNT(*) AS jumlah
FROM 'datapeg.csv'
GROUP BY GolonganRuang
ORDER BY rata_rata_usia;
Back to Blog

Related posts

Read more »

Jupyter Notebook start

What is Jupyter Notebook? Interactive coding environment for Python and other languages like R, Julia via kernels. Modes in Jupyter - Command Mode – used to co...

Using MotherDuck with PlanetScale

DuckDB has gained significant traction for OLAP workloads.It's powerful, flexible, and has a feature-rich SQL dialect, making it perfect to use for analytics al...