NumPy - Creating Arrays
What will be the output of this code?
import numpy as np arr = np.array([[1, 2], [3, 4]]) print(arr.shape)
import numpy as np arr = np.array([[1, 2], [3, 4]]) print(arr.shape)
arr.shape returns the dimensions as a tuple (rows, columns), which is (2, 2).15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions