NumPy - Array Manipulation
What is the shape of the array after applying
np.squeeze() to arr = np.array([[[1], [2], [3]]])?np.squeeze() to arr = np.array([[[1], [2], [3]]])?arr has shape (1, 3, 1) because it is a 3D array with one element in first and last dimension.np.squeeze() removes all dimensions of size 1, so the first and last dimensions are removed, leaving shape (3,).15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions