collections

Working with lists, maps, and sets in Groovy.

Jupyter Notebook and Google Colab: The Data Science Setup

A Jupyter notebook lets you write Python in small cells and run them one at a time, with each result appearing right under its code instead of at the end of a whole file. That tight feedback loop is why data science happens in notebooks. This post covers cells and the kernel, installing JupyterLab, Google Colab, magics, inline plots, and the out-of-order trap that bites almost every beginner. “A notebook is a lab bench, not a factory floor. You experiment ... Read More

Trees and Graphs in Python: BFS and DFS From Scratch

Trees and graphs in Python are the data structures behind almost everything that has a shape you can draw with dots and lines: a folder tree, a family tree, a social network, a map of roads, the import graph of your own project. This post builds them from scratch with plain classes and dictionaries, then runs breadth-first search (BFS) and depth-first search (DFS) so you can watch the two most important graph algorithms actually move through the data. “Show me ... Read More

Python Project: Build a Log Parser CLI (Regex + argparse)

This Python log parser project takes five separate skills you have met one at a time, regular expressions, dataclasses, the Counter, datetime, and argparse, and welds them into a single command line tool you would actually reach for at work. Server logs are where a lot of real debugging starts, and by the end of this post you will have a tool that reads a ten thousand line access log and answers real questions about it in under a second. ... Read More