1、按行排序
axis = 1 或为默认值
x = np.array([[51,12,31], [4,15,6], [30,11,12]])
print(np.sort(x, axis=1))
[[12 31 51]
[ 4 6 15]
[11 12 30]]
2、按行排序
axis = 1 或为默认值
x = np.array([[51,12,31], [4,15,6], [30,11,12]])
print(np.sort(x, axis=0))
[[ 4 11 6]
[30 12 12]
[51 15 31]]