xarray.DataArray.str.slice_replace¶
-
DataArray.str.
slice_replace
(start=None, stop=None, repl='')¶ Replace a positional slice of a string with another value.
- Parameters
start (int, optional) – Left index position to use for the slice. If not specified (None), the slice is unbounded on the left, i.e. slice from the start of the string.
stop (int, optional) – Right index position to use for the slice. If not specified (None), the slice is unbounded on the right, i.e. slice until the end of the string.
repl (str, optional) – String for replacement. If not specified, the sliced region is replaced with an empty string.
- Returns
replaced
- Return type
same type as values