Write a NumPy program to remove single-dimensional entries from a specified shape.Specified shape: (3, 1, 4).
import numpy as np x = np.zeros((3, 1, 4)) print(np.squeeze(x).shape)
Sample Output:
(3, 4)
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer