Remove single-dimensional entries from the shape of an array.
a : array_like
Input data.
squeezed : ndarray
The input array, but with with all dimensions of length 1 removed. Whenever possible, a view on a is returned.
Examples
>>> x = np.array([[[0], [1], [2]]]) >>> x.shape (1, 3, 1) >>> np.squeeze(x).shape (3,)
numpy.ma.expand_dims
numpy.ma.MaskedArray.squeeze
Enter search terms or a module, class or function name.