xxxxxxxxxx
import numpy as np
arr = np.array([1,2,3])
arr.ndim
xxxxxxxxxx
a = np.arange(3)
b = np.arange(12).reshape((3, 4))
c = np.arange(24).reshape((2, 3, 4))
print(a.ndim) # 1
print(b.ndim) # 2
print(c.ndim) # 3
xxxxxxxxxx
myArray.shape # Returns the number of rows, columns etc. (depends on dimensions how many numbers you get)
print(a_1d.shape)
# (3,)
print(type(a_1d.shape))
# <class 'tuple'>
print(a_2d.shape)
# (3, 4)
print(a_3d.shape)
# (2, 3, 4)