Back to Numerical Arrays (NumPy)
np.squeeze
Remove axes of length one from array.
Syntax
np.squeeze(a, axis?)
Description
Remove axes of length one from array.
Parameters
| Name | Description |
|---|---|
| a | - Input array |
| axis(optional) | - Specific axis to squeeze (optional, -1 for all size-1 axes) |
Returns
NDArray