Remove single-dimensional entries from the shape of an array.
Parameters : | a : array_like
axis : None or int or tuple of ints, optional
|
---|---|
Returns : | squeezed : ndarray
|
Examples
>>> x = np.array([[[0], [1], [2]]])
>>> x.shape
(1, 3, 1)
>>> np.squeeze(x).shape
(3,)
>>> np.squeeze(x, axis=(2,)).shape
(1, 3)