desc.grid.Grid.replace_at_axis

Grid.replace_at_axis(x, y, copy=False, **kwargs)Source

Replace elements of x with elements of y at the axis of grid.

Parameters:
  • x (array-like) – Values to selectively replace. Should have length grid.num_nodes.

  • y (array-like) – Replacement values. Should broadcast with arrays of size grid.num_nodes. Can also be a function that returns such an array. Additional keyword arguments are then input to y.

  • copy (bool) – If some value of x is to be replaced by some value in y, then setting copy to true ensures that x will not be modified in-place.

Returns:

out (ndarray) – An array of size grid.num_nodes where elements at the indices corresponding to the axis of this grid match those of y and all others match x.