What does shape of an array mean? Consider the following example:
import numpy as np
arr = np.array([[1]])
print(arr) # output: [[1]]
print(arr.ndim) # output: 2
print(arr.shape) # output: (1, 1)
What does shape of an array mean? Consider the following example:
import numpy as np
arr = np.array([[1]])
print(arr) # output: [[1]]
print(arr.ndim) # output: 2
print(arr.shape) # output: (1, 1)