Back to Numerical Arrays (NumPy)
np.split
Split an array into multiple sub-arrays of equal size.
Syntax
np.split(arr, indices_or_sections, axis?)
Description
Split an array into multiple sub-arrays of equal size. Raises error if array cannot be split into equal sections.
Parameters
| Name | Description |
|---|---|
| arr | - Array to split |
| indices_or_sections | - Number of equal sections or split indices |
| axis(optional) | - Axis along which to split (default: 0) |
Returns
NDArray[]