この回答から回答の一部を貼り付けるだけです:
Numpy では、dimension、axis/axes、shapeは関連しており、時には同様の概念です:
In [1]: import numpy as np
In [2]: a = np.array([[1,2],[3,4]])
寸法
数学/物理学では、次元または次元性は、空間内の任意の点を指定するために必要な座標の最小数として非公式に定義されています。しかし、Numpyでは、 numpy docによると、軸/軸と同じです:
Numpy では、次元は軸と呼ばれます。軸数はランクです。
In [3]: a.ndim # num of dimensions/axes, *Mathematics definition of dimension*
Out[3]: 2
軸/軸
Numpy でan にインデックスを付けるn 番目の座標。array
また、多次元配列は、軸ごとに 1 つのインデックスを持つことができます。
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