Data will become our gold in the future.
numpy数组中的轴不太容易理解,但是却非常重要。官方定义为:轴即维度(In Numpy dimensions are called axes.)。
对于二维数组,0轴即代表数组的行,1轴代表数组的列,对二维数组:1
2
3
4
5arr1 = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
arr1
array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
其轴0、1如下图所示:
1 | 0) arr1.sum(axis= |