In [3]: a.ndim # num of dimensions/axes, *Mathematics definition of dimension*
Out[3]: 2
轴/轴
n坐标在Numpy中索引array。多维数组每个轴可以有一个索引。
In [4]: a[1,0] # to index `a`, we specific 1 at the first axis and 0 at the second axis.
Out[4]: 3 # which results in 3 (locate at the row 1 and column 0, 0-based index)
形状
描述沿每个可用轴有多少数据(或范围)。
In [5]: a.shape
Out[5]: (2, 2) # both the first and second axis have 2 (columns/rows/pages/blocks/...) data