Loading tutorials
axis argument only makes sense once you can read an array's shape without effort. This chapter builds that skill. You will learn what shape, ndim, and size report, how each position in the shape tuple is an axis, and how to find the line of values that an axis runs along. Later chapt5 min readnp.array and np.arange, read an array's shape, and write basic Python. It covers the simplest form of aggregation, where a whole array collapses to one number. The next chapter adds the axis argument, which lets you reduce in a chosen direction5 min readnp.array and np.arange, read an array's shape, and index a two-dimensional array with a[row, column]. It covers how the axis argument selects the direction of a reduction, how to predict what disappears from the shape, and which errors to exp5 min readaxis argument of sum picks between column totals and row totals, and how to predict the shape of the result. It assumes you know basic Python syntax, can build arrays with np.array and np.arange, and know that shape is a tuple with one length per dimension.5 min readnp.array and np.arange, read an array's shape tuple, and know that axis picks the direction of a reduction. Here you will learn to state the shape of any aggregation result before you run it. That skill catches broadcasting bugs early.4 min readnp.array and np.arange, read an array's shape, and compute sum, mean, max, and min with an axis argument. It also assumes you know the basic broadcasting rule, described below.4 min readnp.array and np.arange, read an array's shape, and run sum, mean, min, and max with an axis argument. It also uses keepdims=True, which the previous chapter introduced. Here you will use aggregates to rescale an array: dividing rows b5 min readnp.array and np.arange, and understand what an array's shape means. It also assumes you have met sum with the axis argument. Here the same rule is applied to statistics: mean, median, std, and var.4 min readmax and min tell you the largest and smallest values. Often you need to know where those values are: which column has the highest score, or which day had the lowest temperature. NumPy answers this with argmax and argmin, which return positions instead of values.5 min readnp.array, np.arange, and reshape, and that you can read an array's shape. It also assumes you already know how axis=0 and axis=1 work on a two-dimensional array. Here we extend that rule to three dimensions, then to several axes at once.6 min readaxis argument of sum, mean, min, and max. It also assumes you know that keepdims=True leaves the reduced axis in the result with length 1. Here you will see what happens when some of the values are missi5 min readnp.array and np.arange, read an array's shape, and use axis with sum, max, and mean. It also assumes you know that a reduction removes the axis it runs over.5 min readnp.array and np.arange, read .shape and .dtype, and use axis with sum, mean, max, and cumsum. It covers what data type NumPy uses for an aggregation result and how to avoid silent wrong answers. Overflow in NumPy produces wrong number5 min readnp.array and np.arange, read an array's shape, and already know sum, mean, max, and keepdims. It collects the errors people make most often with axis. Some of these errors raise an exception. The dangerous ones return a wrong answer wit5 min read