Split an array into multiple sub-arrays of equal size.
Parameters: | ary : ndarray
indices_or_sections: integer or 1D array :
axis : integer, optional
|
---|---|
Returns: | sub-arrays : list
|
Raises: | ValueError :
|
See also
Examples
>>> x = np.arange(9.0)
>>> np.split(x, 3)
[array([ 0., 1., 2.]), array([ 3., 4., 5.]), array([ 6., 7., 8.])]
>>> x = np.arange(8.0)
>>> np.split(x, [3, 5, 6, 10])
<BLANKLINE>
[array([ 0., 1., 2.]),
array([ 3., 4.]),
array([ 5.]),
array([ 6., 7.]),
array([], dtype=float64)]