multidimensional array - Python axis indicator issue in numpy.delete() and numpy.sum() -


in

http://docs.scipy.org/doc/numpy/reference/generated/numpy.sum.html

>>> np.sum([[0, 1], [0, 5]], axis=0) array([0, 6]) >>> np.sum([[0, 1], [0, 5]], axis=1) array([1, 5]) 

so looks axis=0 y-axis, i.e., going vertically. however, in

http://docs.scipy.org/doc/numpy/reference/generated/numpy.delete.html

>>> arr = np.array([[1,2,3,4], [5,6,7,8], [9,10,11,12]]) >>> arr array([[ 1,  2,  3,  4],        [ 5,  6,  7,  8],        [ 9, 10, 11, 12]]) >>> np.delete(arr, 1, 0) array([[ 1,  2,  3,  4],        [ 9, 10, 11, 12]] 

axis=0 indicates x-axis, i.e., going horizontally.

why axis behaviors different in 2 methods?