You can check the shape of the NumPy array with the following code. If you want to learn Python, I highly recommend reading This Book.
Example 1
import numpy as np a = np.array([[5,10,15],[20,25,30]]) print(a.shape)
Output:
(2, 3)
Example 2
import numpy as np a = np.array([[5,1]]) print(a.shape)
Output:
(1, 2)
Example 3
import numpy as np a = np.array([5,10,15]) print(a.shape)
Output:
(3,)
Example 4
import numpy as np a = np.array([[5,10,15,20],[20,25,30,50],[35,40,45,60]]) print(a.shape)
Output:
(3, 4)
Example 5
import numpy as np a = np.array([[[5,10,15,20],[20,25,30,50],[35,40,45,60]]]) print(a.shape)
Output:
(1, 3, 4)
People are also reading:
What is Computer Vision? Examples, Applications, Techniques
Books for Machine Learning (ML)