🍾 Xarray is now 10 years old! 🎉

xarray.DataArray.str.get

xarray.DataArray.str.get#

DataArray.str.get(i, default='')[source]#

Extract character number i from each string in the array.

If i is array-like, they are broadcast against the array and applied elementwise.

Parameters:
  • i (int or array-like of int) – Position of element to extract. If array-like, it is broadcast.

  • default (str or bytes, default: "") – Value for out-of-range index.

Returns:

items (array of object)