xarray.DataArray.str.isalnum#
- DataArray.str.isalnum()[source]#
Check whether all characters in each string are alphanumeric.
- Returns:
isalnum (array of
bool
) – Array of boolean values with the same shape as the original array.
Examples
>>> da = xr.DataArray(["H2O", "NaCl-"], dims="x") >>> da <xarray.DataArray (x: 2)> Size: 40B array(['H2O', 'NaCl-'], dtype='<U5') Dimensions without coordinates: x >>> isalnum = da.str.isalnum() >>> isalnum <xarray.DataArray (x: 2)> Size: 2B array([ True, False]) Dimensions without coordinates: x