1
>import numpy as np
>a = np.arange(15).reshape(3, 5)
([[ 0, 1, 2, 3, 4],
[ 5, 6, 7, 8, 9],
[10, 11, 12, 13, 14]])
> a.shape
(3, 5)
> a.ndim
2 /// how to calculate it for any narray
>import numpy as np
>a = np.arange(15).reshape(3, 5)
([[ 0, 1, 2, 3, 4],
[ 5, 6, 7, 8, 9],
[10, 11, 12, 13, 14]])
> a.shape
(3, 5)
> a.ndim
2 /// how to calculate it for any narray
ndim
あなたはサイズの大きさ3と第2の最初の2次元、5
len(a.shape)
と同じです