xarray.DataArray.str.slice#
- DataArray.str.slice(start=None, stop=None, step=None)[source]#
Slice substrings from each string in the array.
If start, stop, or ‘step` is array-like, they are broadcast against the array and applied elementwise.
- Parameters:
start (
int
or array-like ofint
, optional) – Start position for slice operation. If array-like, it is broadcast.stop (
int
or array-like ofint
, optional) – Stop position for slice operation. If array-like, it is broadcast.step (
int
or array-like ofint
, optional) – Step size for slice operation. If array-like, it is broadcast.
- Returns:
sliced strings (
same type as values
)