Check whether all characters in each string are decimal. Returns ------- isdecimal : array of bool Array of boolean values with the same shape as the original array. Examples -------- >>> da = xr.DataArray(["2.3", "123", "0"], di
(self)
| 900 | return self._apply(func=lambda x: x.isalpha(), dtype=bool) |
| 901 | |
| 902 | def isdecimal(self) -> T_DataArray: |
| 903 | """ |
| 904 | Check whether all characters in each string are decimal. |
| 905 | |
| 906 | Returns |
| 907 | ------- |
| 908 | isdecimal : array of bool |
| 909 | Array of boolean values with the same shape as the original array. |
| 910 | |
| 911 | Examples |
| 912 | -------- |
| 913 | >>> da = xr.DataArray(["2.3", "123", "0"], dims="x") |
| 914 | >>> da |
| 915 | <xarray.DataArray (x: 3)> Size: 36B |
| 916 | array(['2.3', '123', '0'], dtype='<U3') |
| 917 | Dimensions without coordinates: x |
| 918 | >>> isdecimal = da.str.isdecimal() |
| 919 | >>> isdecimal |
| 920 | <xarray.DataArray (x: 3)> Size: 3B |
| 921 | array([False, True, True]) |
| 922 | Dimensions without coordinates: x |
| 923 | """ |
| 924 | return self._apply(func=lambda x: x.isdecimal(), dtype=bool) |
| 925 | |
| 926 | def isdigit(self) -> T_DataArray: |
| 927 | """ |