↓ Skip to main content

Production

Why Parquet Dominates Modern Data Engineering

Why Parquet Dominates Modern Data Engineering

Changing one line from CSV to Parquet makes reading the fares of ten million New York taxi trips 27 times faster, and the file is a sixth of the size. In this chapter, we measure why with Polars, DuckDB, PyArrow, and pandas: columnar storage, types in the file, the footer, encodings, pages, compression, predicate pushdown, and row group size. We also see where row storage still wins.
Object-Oriented Programming Greatest Hits

Object-Oriented Programming Greatest Hits

In the age of AI, syntax by itself is the least important part of object-oriented programming to focus on. In this chapter, we cover classes, instance and class attributes, static and class methods, properties, encapsulation, inheritance, composition, and polymorphism against a problem from production code, a rate limiter for alerts. Along the way, we see what the SOLID principles warn about, what inheritance costs, and why composition is the more flexible approach.
Why the Hardest Concept for Python Devs Is Concurrency: asyncio vs threading vs multiprocessing

Why the Hardest Concept for Python Devs Is Concurrency: asyncio vs threading vs multiprocessing

Concurrency is arguably the hardest concept for Python developers, because the important ideas already assume you understand the operating system underneath. In this chapter, we start from the kernel and system calls, build up processes, threads, race conditions, and the GIL, then work out when to reach for asyncio, threading, or multiprocessing, why a GPU beats a CPU on the same arithmetic, and how to get better at concurrent programming.
PhD in Python Functions

PhD in Python Functions

From kindergarten to PhD, this may be the most comprehensive chapter on Python functions. We start with the basics of defining and calling functions, learn how to write them well, then learn closures, decorators, recursion, and generators, all the way to theory of computation and how CPython executes functions under the hood.