## Normalizing Images in PyTorch

Ben Cook • Posted 2021-01-15 • Last updated 2021-10-21

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

Ben Cook • Posted 2021-01-14 • Last updated 2021-10-15

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.

## The Easiest Way to Rename a Column in Pandas

Ben Cook • Posted 2021-01-12 • Last updated 2021-10-15

Two easy recipes for renaming column(s) in a Pandas DataFrame.

## Reshaping Arrays: How the NumPy Reshape Operation Works

Ben Cook • Posted 2021-01-11 • Last updated 2021-10-21

This post explains how the NumPy reshape operation works, how to use it and gotchas to watch out for.

## NumPy Norm: Understanding np.linalg.norm()

Ben Cook • Posted 2021-01-08 • Last updated 2021-10-15

You can calculate the L1 and L2 norms of a vector or the Frobenius norm of a matrix in NumPy with np.linalg.norm(). This post explains the API and gives a few concrete usage examples.

## Scientific Notation in Python and NumPy

Ben Cook • Posted 2021-01-04 • Last updated 2021-10-15

Using and suppressing scientific notation in Python and NumPy.

## NumPy Tile: Understanding np.tile()

Ben Cook • Posted 2021-01-02 • Last updated 2021-10-15

The unofficial guide to np.tile() with examples.

## Failed to Load the Native TensorFlow Runtime: The Unofficial Troubleshooting Guide

Ben Cook • Posted 2021-01-02 • Last updated 2021-03-24

Sometimes TensorFlow will seem to be installed correctly with pip only to fail when you try to import the package with the message…

## NumPy Square: Understanding np.square()

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

You can get the element-wise square of an input with np.square(). This is not exactly the same as x**2.

## Generate Random Uniform Numbers in NumPy

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

The unofficial guide to np.random.uniform()