AI engineering glossary · NumPy pandas visualization
What is axis?
Axis: A numbered direction along which an array operation is applied. In a 2-D array, axis 0 runs down the rows and axis 1 runs across the columns. Passing an axis to a function such as sum or mean tells it which dimension to collapse, and confusing the two is a very common mistake.
Axis: an example
For a marks table of 4 students by 3 subjects, marks.mean(axis=0) returns 3 subject averages, while marks.mean(axis=1) returns 4 student averages.
Related terms
More NumPy pandas visualization terms
Where you learn it
Axis is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.