How to Use the Pandas Melt Command

Ben Cook • Posted 2020-12-22 • Last updated 2021-10-15

The Pandas melt command unpivots tabular data, transforming it from wide to long format. To understand this operation, you have to know…

Object Tracking in 75 Lines of Code

Ben Cook • Posted 2020-08-01 • Last updated 2022-01-04

Object tracking is pretty easy conceptually. And if you have a good detector, simple methods can be pretty effective.

Cross Entropy Loss in PyTorch

Ben Cook • Posted 2020-07-24 • Last updated 2021-10-14

Cross entropy loss in PyTorch can be a little confusing. Here is a simple explanation of how it works for people who get stuck.

Pairwise Distance in NumPy

Ben Cook • Posted 2020-06-01 • Last updated 2021-10-15

You can do vectorized pairwise distance calculations in NumPy (without using SciPy). This lets you extend pairwise computations to other kinds of functions.

Everything is a Pipeline

Ben Cook • Posted 2020-05-21 • Last updated 2021-03-24

DAGs are everywhere in scientific computing and understanding them is key to running large computations efficiently.

Use Informative Names

Ben Cook • Posted 2020-05-18 • Last updated 2021-03-24

Informative names make programming easier. Here are a few suggestions you can use to write better names in your code.