The array_split Package¶
Python package for splitting a numpy.ndarray (or just an array shape)
into a number of sub-arrays.
The two main functions are:
array_split.array_split()Similar to
numpy.array_split(), returns a list of sub-array views of the inputnumpy.ndarray. Can split along multiple axes and has more splitting criteria (parameters) thannumpy.array_split().array_split.shape_split()Instead taking an
numpy.ndarrayas an argument, it takes the array shape and returns tuples ofsliceobjects which indicate the extents of the sub-arrays.
These two functions use an instance of the array_split.ShapeSplitter class
which contains the bulk of the split implementation.
Instances of array_split.ShapeSplitter also
maintain state related to the computed split.
Splitting of multi-dimensional arrays can be performed according to several criteria:
Per-axis indices indicating the cut positions.
Per-axis number of sub-arrays.
Total number of sub-arrays (with optional per-axis number of sections constraints).
Specific sub-array shape.
Specification of halo (ghost) elements for sub-arrays.
Arbitrary start index for the shape to be partitioned.
Maximum number of bytes for a sub-array with constraints:
sub-arrays are an even multiple of a specified sub-tile shape
upper limit on the per-axis sub-array shape
The usage documentation is given in the Examples section.
Classes and Functions¶
|
Splits specified |
|
Splits the specified array |
|
Implements array shape splitting. |
Attributes¶
- array_split.ARRAY_BOUNDS = <property object>¶
- array_split.NO_BOUNDS = <property object>¶