Some people are confused about the axis parameter of some numpy functions.
This link should clarify:
https://medium.com/@aerinykim/numpy-sum-axis-intuition-6eb94926a5d1
The gist of it is, the specified axis is the one that is "collapsed" by the operation.
Hope this helps.