bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / array_split
_ArrayFunctionDispatcher
numpy:array_split
source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/lib/_shape_base_impl.py :737
Signature
def array_split ( ary , indices_or_sections , axis = 0 ) Summary
Split an array into multiple sub-arrays.
Extended Summary
Please refer to the split documentation. The only difference between these functions is that array_split allows indices_or_sections to be an integer that does not equally divide the axis. For an array of length l that should be split into n sections, it returns l % n sub-arrays of size l//n + 1 and the rest of size l//n.
Examples
import numpy as np x = np.arange(8.0)✓
np.array_split(x, 3)
✗x = np.arange(9) np.array_split(x, 4)✓
See also
- split
Split array into multiple sub-arrays of equal size.
Aliases
-
numpy.array_split