WeCodeAcademy

Sums, Means and Axes

Aggregate methods boil an array down: sum, mean, min, max, std. argmax and argmin give the position of the largest and smallest. On a 2D array, axis=0 works down the columns and axis=1 works along the rows.

Examplepython
Open in editor »
Quick check

For a 2D array, `axis=1` aggregates...

Your turn: write the code

Print the mean of each column of the grid (axis=0).

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.