xarray.core.accessor_str.StringAccessor.isalpha

xarray.core.accessor_str.StringAccessor.isalpha#

StringAccessor.isalpha()[source]#

Check whether all characters in each string are alphabetic.

Returns

isalpha (array of bool) – Array of boolean values with the same shape as the original array.

Examples

>>> da = xr.DataArray(["Mn", "H2O", "NaCl-"], dims="x")
>>> da
<xarray.DataArray (x: 3)> Size: 60B
array(['Mn', 'H2O', 'NaCl-'], dtype='<U5')
Dimensions without coordinates: x
>>> isalpha = da.str.isalpha()
>>> isalpha
<xarray.DataArray (x: 3)> Size: 3B
array([ True, False, False])
Dimensions without coordinates: x