Back to Numerical Arrays (NumPy)
np.expand_dims
Expand the shape of an array by inserting a new axis.
Syntax
np.expand_dims(a, axis)
Description
Expand the shape of an array by inserting a new axis.
Parameters
| Name | Description |
|---|---|
| a | - Input array |
| axis | - Position in the expanded axes where the new axis is placed |
Returns
NDArray