RectPartition.insert¶
- RectPartition.insert(index, *parts)[source]¶
Return a copy with
parts
inserted beforeindex
.The given partitions are inserted (as a block) into
self
, yielding a new partition whose number of dimensions is the sum of the numbers of dimensions of all involved partitions. Note that no changes are made in-place.- Parameters:
- indexint
Index of the dimension before which
other
is to be inserted. Negative indices count backwards fromself.ndim
.- part1, ..., partN
RectPartition
Partitions to be inserted into
self
.
- Returns:
- newpart
RectPartition
The enlarged partition.
- newpart
See also
Examples
>>> part1 = odl.uniform_partition([0, -1], [1, 2], (3, 3)) >>> part2 = odl.uniform_partition(0, 1, 5) >>> part1.insert(1, part2) uniform_partition([ 0., 0., -1.], [ 1., 1., 2.], (3, 5, 3))