Tools 1.5Lesson outlineLesson 5 of 7 in Module 1
Aggregations Along Axes
Sum, average and find extremes over rows or columns.
Free sample. Everything in this module opens with a free account.Video in production.
Lesson outline: Aggregations Along Axes
In this lesson12 parts
- 01Two questions about one grid: per shop, and per day
- 02Answering both with nested Python loops
- 03sum with no argument: the whole array to one number
- 04sum with axis zero and axis one: the axis you name disappears
- 05Naming an axis that is not there, and naming the wrong one
- 06mean, min, max and std take the same axis argument
- 07keepdims: collapsing an axis to one so the result still broadcasts
- 08argmax: positions instead of values, and reading the value back
- 09argsort: the positions that put an array in order
- 10Counting a mask along an axis, and any and all
- 11How one nan spreads through a reduction, and the nan functions
- 12Recap and your challenge
Key terms: Aggregations Along Axes
The words this lesson introduces, each in one line. The module’s glossary collects them all, and the AI glossary has every term across the courses.
- Axis
- Dimension named by an operation; reduction removes that dimension
- Reduction
- Combining values along an axis, such as
sumormean keepdims- Retain a reduced axis with size one
argmax- Position of the maximum, not the maximum value
Quiz: Aggregations Along Axes
Your first pick on each question is the one that counts. Getting one wrong here is how the lesson sticks.