Installing packages in a Jupyter notebook

This post describes a trick for installing/upgrading Python packages in a Jupyter notebook. It's useful for scratch code, but don't do this when you need reproducible code.

Normalizing Images in PyTorch

You can use the torchvision Normalize() transform to subtract the mean and divide by the standard deviation for image tensors in PyTorch. But it's important to understand how the transform works and how to reverse it.

Dropping columns and rows in Pandas

There are a few ways to drop columns and rows in Pandas. This post describes the easiest way to do it and provides a few alternatives that can sometimes be useful.