Loading tutorials
ndarray as a typed, fixed-size block of data. Later chapters cover shape, dtype conversion, and indexing in depth. Here the focus is how each creation rou4 min readndarray is, and can create arrays with np.array, np.zeros, and np.arange. Here you will learn the three attributes that describe an array's geometry: shape, ndim, and size. You will also learn how they relate to each ot5 min readshape, ndim, and size. It also assumes basic Python numeric types (int, float, bool). After it, you should be able to predict the dtype of a result, convert between dtypes on purpose, and spot the silent errors that fixed-size numbers c5 min readshape and ndim. It also assumes you know Python list indexing and slice syntax (start:stop:step). It covers the basic indexing forms that return views or single elements. Boolean masks and integer-array (fancy) indexing have their own c4 min readshape and strides, and use basic slicing such as a[1:4]. It covers which NumPy operations share memory with the original array, which allocate new memory, and the bugs that follow when you guess wrong.4 min readshape and dtype, and use basic slicing. It also assumes you know that a basic slice returns a view. Here you will learn the two kinds of "advanced" indexing: boolean masks and integer-array (fancy) indexing. You will see how they differ from slice5 min readshape and dtype, and that you know the difference between a view and a copy. Broadcasting gets its own chapter, so here it appears only as a brief mention.4 min readaxis reductions from the earlier chapters. It covers the rules, how to apply them by hand, how to shape arrays o5 min readshape, and know that operations on arrays of different shapes follow the broadcasting rules. You will use all three here.4 min readshape, ndim, and dtype. It also assumes you know the view-versus-copy distinction from the earlier chapte4 min readndarray basics from earlier chapters: shape, ndim, dtype, and axes. Joining arrays looks simple, but most errors come from confusing two operations. One extends an existing axis. The other creates a new axis.4 min read@ operator, how it differs from elementwise *, and the shape rules that decide whether a product is defined. It also covers a few functions from np.linalg. It assumes you know what shape, ndim, and dtype mean, and that you have seen broadcasting. You should also know wh5 min readaxis in reductions. Those topics come from earlier chapters. Here you will learn how NumPy's random number system is built, which methods produce which kinds of arrays, and how to keep results reproducible.4 min read