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-"], di
(self)
| 852 | return self._apply(func=lambda x: normalize(form, x)) # type: ignore[arg-type] |
| 853 | |
| 854 | def isalnum(self) -> T_DataArray: |
| 855 | """ |
| 856 | Check whether all characters in each string are alphanumeric. |
| 857 | |
| 858 | Returns |
| 859 | ------- |
| 860 | isalnum : array of bool |
| 861 | Array of boolean values with the same shape as the original array. |
| 862 | |
| 863 | Examples |
| 864 | -------- |
| 865 | >>> da = xr.DataArray(["H2O", "NaCl-"], dims="x") |
| 866 | >>> da |
| 867 | <xarray.DataArray (x: 2)> Size: 40B |
| 868 | array(['H2O', 'NaCl-'], dtype='<U5') |
| 869 | Dimensions without coordinates: x |
| 870 | >>> isalnum = da.str.isalnum() |
| 871 | >>> isalnum |
| 872 | <xarray.DataArray (x: 2)> Size: 2B |
| 873 | array([ True, False]) |
| 874 | Dimensions without coordinates: x |
| 875 | """ |
| 876 | return self._apply(func=lambda x: x.isalnum(), dtype=bool) |
| 877 | |
| 878 | def isalpha(self) -> T_DataArray: |
| 879 | """ |