np.sort(a, 1) 对行进行排序
a = np.array([[ 2, 7, 4, 2],
[35, 9, 1, 5],
[22, 12, 3, 2]])
A = np.sort(a,1)
print(A)
>>>
[[ 2 2 4 7]
[ 1 5 9 35]
[ 2 3 12 22]]
np.sort(a, 0) 对列进行排序
a = np.array([[ 2, 7, 4, 2],
[35, 9, 1, 5],
[22, 12, 3, 2]])
A = np.sort(a,0)
print(A)
>>>
[[ 2 7 1 2]
[22 9 3 2]
[35 12 4 5]]