# numpy

## PyTorch Tensor to NumPy Array and Back

2021-03-22

You can easily convert a NumPy array to a PyTorch tensor and a PyTorch tensor to a NumPy array. This post explains how it works.

## NumPy Where: Understanding np.where()

2021-03-03

The NumPy where function is like a vectorized switch that you can use to combine two arrays.

## NumPy All: Understanding np.all()

2021-02-25

The np.all() function tests whether all elements in a NumPy array evaluate to true.

## Linear Interpolation in Python: An np.interp() Example

2021-02-15

It’s easy to linearly interpolate a 1-dimensional set of points in Python using the np.interp() function from NumPy.

## NumPy Meshgrid: Understanding np.meshgrid()

2021-02-09

You can create multi-dimensional coordinate arrays using the np.meshgrid() function, which is also available in PyTorch and TensorFlow. But watch out! PyTorch uses different indexing by default so the results might not be the same.

## Numpy Pad: Understanding np.pad()

2021-01-30

The np.pad() function has a complex, powerful API. But basic usage is very simple and complex usage is achievable! This post shows you how to use NumPy pad and gives a couple examples.

## Reshaping Arrays: How the NumPy Reshape Operation Works

2021-01-11

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()

2021-01-08

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

2021-01-04

Using and suppressing scientific notation in Python and NumPy.

## NumPy Tile: Understanding np.tile()

2021-01-02

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