Complete the code to create an uninitialized NumPy array of shape (3, 3).
import numpy as np arr = np.[1]((3, 3)) print(arr)
The np.empty() function creates an uninitialized array of the given shape. It does not set values to zero or one.
Complete the code to create an uninitialized array of integers with shape (2, 4).
import numpy as np arr = np.empty((2, 4), dtype=[1]) print(arr)
Setting dtype=int creates an array of integers. The np.empty() function does not initialize values.
Fix the error in the code to create an uninitialized array of shape (5,).
import numpy as np arr = np.empty([1]) print(arr)
The shape argument must be a tuple. For a 1D array of length 5, use (5,).
Fill both blanks to create an uninitialized 2D array of floats with shape (3, 2).
import numpy as np arr = np.[1]([2], dtype=float) print(arr)
zeros instead of emptyUse np.empty with a tuple shape (3, 2) to create an uninitialized 2D float array.
Fill all three blanks to create an uninitialized array with shape (4, 4), integer type, and print its shape.
import numpy as np arr = np.[1]([2], dtype=[3]) print(arr.shape)
float dtype instead of intUse np.empty with shape (4, 4) and dtype=int to create the array. Printing arr.shape shows the array's dimensions.