Loading tutorials
np.3 min readshape, ndim and dtype mean (from the previous chapter) and can run Python code that imports NumPy. You will learn the main ways to build an array and how each one decides the shape and dtype.2 min readshape and ndim. Here you will learn to select single elements and sub-arrays from a NumPy array. You will also see how the result's shape follows from the index you write.2 min readshape and dtype. It also assumes you know how indexing selects data. Here you will see how NumPy applies an operation to every element of an array at once.2 min readshape and ndim, and apply elementwise operations such as a + 1 or np.sqrt(a). It covers how reductions collapse an array along a chosen axis and how to predict the result shape.3 min readshape and ndim. It also assumes you know basic indexing. Reshaping and stacking change an array's shape without changing the values. You will need both to line shapes up for broadcasting in the next chapters.2 min readshape, and apply elementwise operations such as a + b on arrays of the same shape. Here you learn what NumPy does when the shapes differ.2 min readaxis does in a reduction. Here you will learn the two tools that make shapes line up when they don't 2 min readnp.newaxis, keepdims, and reductions along an axis. Here you apply them to three common jobs: centering columns, centering rows, and computing pairwise distances.2 min readnp.where combines them into a vectorized if/else.2 min readnp.newaxis, and keepdims from the earlier chapters. It covers the two ways broadcasting goes wrong. It can raise an error, or it can succeed and return a result you did not intend.2 min read