array_split.split.shape_split¶
-
array_split.split.shape_split(array_shape, *args, **kwargs)[source]¶ Splits specified
array_shapein tiles, returns array ofslicetuples.Parameters: - array_shape (sequence of
int) – The shape to be split. - indices_or_sections (
None,intor sequence ofint) – If an integer, indicates the number of elements in the calculated split array. If a sequence, indicates the indices (per axis) at which the splits occur. See Splitting by number of tiles examples. - axis (
None,intor sequence ofint) – If an integer, indicates the axis which is to be split. If a sequence integers, indicates the number of slices per axis, i.e. ifaxis = [3, 5]then axis0is cut into 3 slices and axis1is cut into 5 slices for a total of 15 (3*5) rectangular slices in the returned(3, 5)shaped split. See Splitting by number of tiles examples and Splitting by per-axis cut indices examples. - array_start (
Noneor sequence ofint) – The start index. Defaults to[0,]*len(array_shape). The array indexing extents are assumed to range fromarray_starttoarray_start + array_shape. See The array_start parameter examples. - array_itemsize (int or sequence of
int) – Number of bytes per array element. Only relevant whenmax_tile_bytesis specified. See Splitting by maximum bytes per tile examples. - tile_shape (
Noneor sequence ofint) – When notNone, specifies explicit shape for tiles. Should be same length asarray_shape. See Splitting by tile shape examples. - max_tile_bytes (
Noneorint) – The maximum number of bytes for calculatedtile_shape. See Splitting by maximum bytes per tile examples. - max_tile_shape (
Noneor sequence ofint) – Per axis maximum shapes for the calculatedtile_shape. Only relevant whenmax_tile_bytesis specified. Should be same length asarray_shape. See Splitting by maximum bytes per tile examples. - sub_tile_shape (
Noneor sequence ofint) – When notNone, the calculatedtile_shapewill be an even multiple of this sub-tile shape. Only relevant whenmax_tile_bytesis specified. Should be same length asarray_shape. See Splitting by maximum bytes per tile examples. - halo (
None,int, sequence ofint, or(len(array_shape), 2)shapednumpy.ndarray) – How tiles are extended per axis in -ve and +ve directions with halo elements. See The halo parameter examples. - tile_bounds_policy (
str) – Specifies whether tiles can extend beyond the array boundaries. Only relevant for halo values greater than one. Iftile_bounds_policyisARRAY_BOUNDSthen the calculated tiles will not extend beyond the array extentsarray_startandarray_start + array_shape. Iftile_bounds_policyisNO_BOUNDSthen the returned tiles will extend beyond thearray_startandarray_start + array_shapeextend for positivehalovalues. See The halo parameter examples.
Return type: Returns: Array of
tupleobjects. Eachtupleelement is asliceobject so that eachtupledefines a multi-dimensional slice of an array of shapearray_shape.- array_shape (sequence of