RectGrid.insert¶
- RectGrid.insert(index, *grids)[source]¶
Return a copy with
gridsinserted beforeindex.The given grids are inserted (as a block) into
self, yielding a new grid whose number of dimensions is the sum of the numbers of dimensions of all involved grids. Note that no changes are made in-place.- Parameters:
- indexint
The index of the dimension before which
gridsare to be inserted. Negative indices count backwards fromself.ndim.- grid1, ..., gridN
RectGrid The grids to be inserted into
self.
- Returns:
- newgrid
RectGrid The enlarged grid.
- newgrid
See also
Examples
>>> g1 = RectGrid([0, 1], [-1, 0, 2]) >>> g2 = RectGrid([1], [-6, 15]) >>> g1.insert(1, g2) RectGrid( [ 0., 1.], [ 1.], [ -6., 15.], [-1., 0., 2.] ) >>> g1.insert(1, g2, g2) RectGrid( [ 0., 1.], [ 1.], [ -6., 15.], [ 1.], [ -6., 15.], [-1., 0., 2.] )