Is the new Raspberry Pi AI Kit better than Google Coral?
135561 Views
Build Your Own AI Assistant Part 1 - Creating the Assistant
121827 Views
Control Arduino with Python using Firmata / PyFirmata
88872 Views
How to Map with LiDAR - using a Raspberry Pi Zero 2W, RPLidar and Rviz
65602 Views
Creating a Supercomputer with a Raspberry Pi 5 Cluster and Docker Swarm!
60799 Views
Node-Red Automation, MQTT, NodeMCU & MicroPython
53953 Views
How to Keep your Raspberry Pi happy
How to Install Pi-Apps on a Raspberry Pi
Pikon II, The Ultimate DIY Raspberry Pi Camera!
Pico Plotter
LEGO Gets Lights & Sound with Tiny FX
Thinkman
DuckDB - Fast, free analytics
1h 36m
Obsidian
1h 0m
Getting Started with C on the Raspberry Pi Pico
0h 50m
Running K3s on Raspberry Pi
1h 28m
From Docker to Podman
1h 2m
MicroPython Robotics Projects with the Raspberry Pi Pico
0h 54m
Learn how to Program in Python, C, Rust, and more.
Learn Linux from the basics to advanced topics.
Learn how to use a Raspberry Pi Pico
Learn MicroPython the best language for MicroControllers
Learn Docker, the leading containerization platform. Docker is used to build, ship, and run applications in a consistent and reliable manner, making it a popular choice for DevOps and cloud-native development.
Learn how to build SMARS robots, starting with the 3D Printing the model, Designing SMARS and Programming SMARS
Learn how to build robots, starting with the basics, then move on to learning Python and MicroPython for microcontrollers, finally learn how to make things with Fusion 360.
Learn Python, the most popular programming language in the world. Python is used in many different areas, including Web Development, Data Science, Machine Learning, Robotics and more.
Learn how to create robots in 3D, using Fusion 360 and FreeCAD. The models can be printed out using a 3d printer and then assembled into a physical robot.
Learn how to create Databases in Python, with SQLite3 and Redis.
KevsRobots Learning Platform
14% Percent Complete
By Kevin McAleer, 3 Minutes
brew install duckdb
python -m pip install duckdb pandas
Create a workspace folder and an exports/ subfolder so COPY/export wonβt fail.
exports/
-- Start the shell: duckdb -- Create a small table from a public CSV CREATE OR REPLACE TABLE tips AS SELECT * FROM read_csv_auto('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv'); -- Simple analytics SELECT day, time, ROUND(AVG(total_bill), 2) AS avg_bill, COUNT(*) AS orders FROM tips GROUP BY day, time ORDER BY avg_bill DESC; -- Export results COPY (SELECT * FROM tips LIMIT 100) TO 'exports/tips_sample.csv' (HEADER, DELIMITER ','); COPY (SELECT * FROM tips) TO 'exports/tips.parquet' (FORMAT PARQUET);
Exit with .quit when done.
.quit
import duckdb, pandas as pd # Read CSV to a DataFrame url = 'https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv' df = pd.read_csv(url) # Query the DataFrame with SQL and get a DataFrame back res = duckdb.query(''' SELECT day, time, ROUND(AVG(total_bill), 2) AS avg_bill, ROUND(AVG(tip / NULLIF(total_bill,0) * 100), 2) AS avg_tip_pct, COUNT(*) AS orders FROM df GROUP BY day, time ORDER BY avg_bill DESC ''').df() print(res) # Persist to a local .duckdb file for reuse con = duckdb.connect('analytics.duckdb') con.execute("CREATE TABLE IF NOT EXISTS tips AS SELECT * FROM df") con.close()
INSTALL httpfs; LOAD httpfs; SELECT COUNT(*) FROM read_parquet('https://duckdb-public-datasets.s3.us-east-1.amazonaws.com/tpch/1/parquet/lineitem/part-00000-*.parquet');
Use folder globs (*) to read many files at once.
*
Create Parquet from a CSV or table in one step. Parquet is faster to read and keeps types.
-- From an existing table COPY (SELECT * FROM tips) TO 'exports/tips.parquet' (FORMAT PARQUET); -- Or, directly from CSV without creating a table COPY ( SELECT * FROM read_csv_auto('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv') ) TO 'exports/tips.parquet' (FORMAT PARQUET);
Notes:
.parquet
FORMAT PARQUET
import duckdb, pandas as pd df = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv') with duckdb.connect() as con: con.execute("COPY (SELECT * FROM df) TO 'exports/tips.parquet' (FORMAT PARQUET)")
See source/duckdb/data/README.md to create tiny local CSV/Parquet samples (e.g., tips.csv, tips.parquet).
source/duckdb/data/README.md
tips.csv
tips.parquet
Then swap the path in examples to point at those local files.
httpfs
PRAGMA threads = 8; PRAGMA memory_limit = '2GB';
< Previous Next >
You can use the arrows β β on your keyboard to navigate between lessons.
β β