Back to Numerical Arrays (NumPy)
np.insert
Insert values along the given axis before the given indices.
Syntax
np.insert(arr, obj, values, axis?)
Description
Insert values along the given axis before the given indices.
Parameters
| Name | Description |
|---|---|
| arr | - Input array |
| obj | - Index or indices before which values are inserted |
| values | - Values to insert |
| axis(optional) | - Axis along which to insert (default: flatten first) |
Returns
NDArray