Code & data science

Learning out loud.

Detailed write-ups of the concepts I meet while working through the 42 Python piscine — arrays, images, NumPy and the ideas underneath them.

Latest articles

Lists, NumPy Arrays & Vectorized Operations

Why Python lists are not arrays, how NumPy changes the game, and how to compute a BMI vector with clean type and shape error handling.

2D Arrays: Shape, Axes & Slicing

How a 2D array is really a list of rows, what .shape actually measures, and how slicing lets you carve out sub-arrays without copying data element by element.

Images Are Just Arrays: Loading RGB Pixels

An image is a 3D array of numbers. Learn how height, width and color channels map onto a NumPy shape, and how to load a JPEG into pixel data safely.

Zoom In: Cropping Images with Slicing & Matplotlib

Zooming is just cropping plus display. Learn how to slice a region of interest out of an image array and render it with scaled axes using matplotlib.

Transpose by Hand: Rotating an Image Without a Library

The transpose swaps the axes of an array. Learn what it does geometrically, why the subject bans np.transpose here, and how to implement it yourself with nested loops.

Pimp My Image: Color-Channel Filters from Scratch

Invert, isolate red/green/blue, and grayscale — five filters built only from arithmetic on the RGB channels, each constrained to a tiny set of operators.